X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FGHC.hs;h=5dfa76c8d41c9d94c3860738c7dcc529a010039a;hb=18766724e350e926e85d10002ebf2a70d375f440;hp=ae2dedfed37f097bf7c109d7d7ca3adf385cc454;hpb=8ca5375714268a61d2549b02204bb44745cb4cbf;p=ghc-hetmet.git diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index ae2dedf..5dfa76c 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -111,13 +111,13 @@ module GHC ( showModule, isModuleInterpreted, InteractiveEval.compileExpr, HValue, dynCompileExpr, - lookupName, GHC.obtainTermFromId, GHC.obtainTermFromVal, reconstructType, modInfoModBreaks, ModBreaks(..), BreakIndex, BreakInfo(breakInfo_number, breakInfo_module), BreakArray, setBreakOn, setBreakOff, getBreak, #endif + lookupName, -- * Abstract syntax elements @@ -243,9 +243,9 @@ import Linker ( HValue ) import ByteCodeInstr import BreakArray import InteractiveEval -import TcRnDriver #endif +import TcRnDriver import TcIface import TcRnTypes hiding (LIE) import TcRnMonad ( initIfaceCheck ) @@ -2723,3 +2723,12 @@ obtainTermFromId bound force id = liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id #endif + +-- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any +-- entity known to GHC, including 'Name's defined using 'runStmt'. +lookupName :: GhcMonad m => Name -> m (Maybe TyThing) +lookupName name = withSession $ \hsc_env -> do + mb_tything <- ioMsg $ tcRnLookupName hsc_env name + return mb_tything + -- XXX: calls panic in some circumstances; is that ok? +