X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FGHC.hs;h=32bcf25b3a433b5ecdf02f141a516a5f9ed72641;hp=5c0dbcd932f2c2ab525f086664ab3ae744b7ae71;hb=025733b8367d9108e8992b2db3dbb9f80cad4fa9;hpb=e34e36a0a7c759dbc542a49ffbc060f95231dabd diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 5c0dbcd..32bcf25 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -82,6 +82,7 @@ module GHC ( RunResult(..), runStmt, showModule, + isModuleInterpreted, compileExpr, HValue, dynCompileExpr, lookupName, @@ -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))