X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FGHC.hs;h=6855f94ccf00a232f2fb22a85e6b51804eda4927;hb=9a37b33443be07667867dabb5b67b1319231e648;hp=5c0dbcd932f2c2ab525f086664ab3ae744b7ae71;hpb=cd290fc88d35d5a32c994664baa56a5eae250e9e;p=ghc-hetmet.git diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 5c0dbcd..6855f94 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -82,11 +82,12 @@ module GHC ( RunResult(..), runStmt, showModule, + isModuleInterpreted, compileExpr, HValue, dynCompileExpr, lookupName, getBreakpointHandler, setBreakpointHandler, - obtainTerm, + obtainTerm, obtainTerm1, #endif -- * Abstract syntax elements @@ -2212,10 +2213,15 @@ foreign import "rts_evalStableIO" {- safe -} -- show a module and it's source/object filenames showModule :: Session -> ModSummary -> IO String -showModule s mod_summary = withSession s $ \hsc_env -> do +showModule s mod_summary = withSession s $ \hsc_env -> + isModuleInterpreted s mod_summary >>= \interpreted -> + return (showModMsg (hscTarget(hsc_dflags hsc_env)) interpreted mod_summary) + +isModuleInterpreted :: Session -> ModSummary -> IO Bool +isModuleInterpreted s mod_summary = withSession s $ \hsc_env -> case lookupUFM (hsc_HPT hsc_env) (ms_mod_name mod_summary) of Nothing -> panic "missing linkable" - Just mod_info -> return (showModMsg (hscTarget (hsc_dflags hsc_env)) (not obj_linkable) mod_summary) + Just mod_info -> return (not obj_linkable) where obj_linkable = isObjectLinkable (expectJust "showModule" (hm_linkable mod_info)) @@ -2286,6 +2292,9 @@ mkSite :: SiteInfo -> BkptLocation Module mkSite (pkgName, modName, sitenum) = (mkModule (stringToPackageId pkgName) (mkModuleName modName), sitenum) +obtainTerm1 :: Session -> Bool -> Maybe Type -> a -> IO Term +obtainTerm1 sess force mb_ty x = withSession sess $ \hsc_env -> cvObtainTerm hsc_env force mb_ty (unsafeCoerce# x) + obtainTerm :: Session -> Bool -> Id -> IO (Maybe Term) obtainTerm sess force id = withSession sess $ \hsc_env -> do mb_v <- getHValue (varName id)