X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcompMan%2FCompManager.lhs;h=bae0a213cddc9828826982ad909f42744ca4d6fc;hb=920d0d7e8f4adf97a2adbc08317522e34de10c65;hp=0e10626e2a67779cf60bdee131c9f6890635ddf4;hpb=435b10867ae4f4a379137e632961c55612c258e3;p=ghc-hetmet.git diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index 0e10626..bae0a21 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -186,11 +186,11 @@ cmRunStmt cmstate dflags expr ic_module = this_mod } = icontext (new_pcs, maybe_stuff) - <- hscStmt dflags hst hit pcs icontext expr + <- hscStmt dflags hst hit pcs icontext expr False{-stmt-} case maybe_stuff of Nothing -> return (cmstate{ pcs=new_pcs }, []) - Just (ids, bcos) -> do + Just (ids, _, bcos) -> do -- update the interactive context let @@ -227,12 +227,24 @@ cmRunStmt cmstate dflags expr #ifdef GHCI cmTypeOfExpr :: CmState -> DynFlags -> String -> IO (CmState, Maybe String) cmTypeOfExpr cmstate dflags expr - = do (new_cmstate, names) - <- cmRunStmt cmstate dflags ("let __cmTypeOfExpr = " ++ expr) - case names of - [name] -> do maybe_tystr <- cmTypeOfName new_cmstate name - return (new_cmstate, maybe_tystr) - _other -> return (new_cmstate, Nothing) + = do (new_pcs, maybe_stuff) + <- hscStmt dflags hst hit pcs ic expr True{-just an expr-} + + let new_cmstate = cmstate{pcs = new_pcs} + + case maybe_stuff of + Nothing -> return (new_cmstate, Nothing) + Just (_, ty, _) -> + let pit = pcs_PIT pcs + modname = moduleName (ic_module ic) + tidy_ty = tidyType emptyTidyEnv ty + str = case lookupIfaceByModName hit pit modname of + Nothing -> showSDoc (ppr tidy_ty) + Just iface -> showSDocForUser unqual (ppr tidy_ty) + where unqual = unQualInScope (mi_globals iface) + in return (new_cmstate, Just str) + where + CmState{ hst=hst, hit=hit, pcs=pcs, ic=ic } = cmstate #endif ----------------------------------------------------------------------------- @@ -270,11 +282,11 @@ cmCompileExpr cmstate dflags expr (new_pcs, maybe_stuff) <- hscStmt dflags hst hit pcs icontext - ("let __cmCompileExpr = "++expr) + ("let __cmCompileExpr = "++expr) False{-stmt-} case maybe_stuff of Nothing -> return (cmstate{ pcs=new_pcs }, Nothing) - Just (ids, bcos) -> do + Just (ids, _, bcos) -> do -- link it hval <- linkExpr pls bcos @@ -801,8 +813,13 @@ upsweep_mod ghci_mode dflags oldUI threaded1 summary1 reachable_from_here source_unchanged = isJust maybe_old_linkable + -- in interactive mode, all home modules below us *must* have an + -- interface in the HIT. We never demand-load home interfaces in + -- interactive mode. (hst1_strictDC, hit1_strictDC) - = retainInTopLevelEnvs + = ASSERT(ghci_mode == Batch || + all (`elemUFM` hit1) reachable_from_here) + retainInTopLevelEnvs (filter (/= (name_of_summary summary1)) reachable_from_here) (hst1,hit1)