[project @ 2004-08-13 13:04:50 by simonmar]
[ghc-hetmet.git] / ghc / compiler / compMan / CompManager.lhs
index 95f31fe..ce6302a 100644 (file)
@@ -4,7 +4,6 @@
 % The Compilation Manager
 %
 \begin{code}
-{-# OPTIONS -fvia-C #-}
 module CompManager ( 
     ModuleGraph, ModSummary(..),
 
@@ -25,9 +24,7 @@ module CompManager (
     cmSetContext,  -- :: CmState -> DynFlags -> [String] -> [String] -> IO CmState
     cmGetContext,  -- :: CmState -> IO ([String],[String])
 
-    cmInfoThing,   -- :: CmState -> DynFlags -> String
-                  --   -> IO (CmState, [(TyThing,Fixity)])
-
+    cmInfoThing,    -- :: CmState -> String -> IO (CmState, [(TyThing,Fixity)])
     cmBrowseModule, -- :: CmState -> IO [TyThing]
 
     CmRunResult(..),
@@ -97,6 +94,7 @@ import BasicTypes     ( Fixity )
 import Linker          ( HValue, unload, extendLinkEnv )
 import GHC.Exts                ( unsafeCoerce# )
 import Foreign
+import SrcLoc          ( SrcLoc )
 import Control.Exception as Exception ( Exception, try )
 #endif
 
@@ -221,7 +219,7 @@ cmSetDFlags cm_state dflags
 -- A string may refer to more than one TyThing (eg. a constructor,
 -- and type constructor), so we return a list of all the possible TyThings.
 
-cmInfoThing :: CmState -> String -> IO [(IfaceDecl,Fixity)]
+cmInfoThing :: CmState -> String -> IO [(IfaceDecl,Fixity,SrcLoc)]
 cmInfoThing cmstate id
    = hscThing (cm_hsc cmstate) (cm_ic cmstate) id
 
@@ -319,9 +317,9 @@ cmTypeOfExpr cmstate expr
 
        case maybe_stuff of
           Nothing -> return Nothing
-          Just ty -> return (Just str)
+          Just ty -> return (Just res_str)
             where 
-               str     = showSDocForUser unqual (text expr <+> dcolon <+> ppr tidy_ty)
+               res_str = showSDocForUser unqual (text expr <+> dcolon <+> ppr tidy_ty)
                unqual  = icPrintUnqual (cm_ic cmstate)
                tidy_ty = tidyType emptyTidyEnv ty
 
@@ -334,9 +332,9 @@ cmKindOfType cmstate str
    = do maybe_stuff <- hscKcType (cm_hsc cmstate) (cm_ic cmstate) str
        case maybe_stuff of
           Nothing -> return Nothing
-          Just kind -> return (Just str)
+          Just kind -> return (Just res_str)
             where 
-               str     = showSDocForUser unqual (text str <+> dcolon <+> ppr kind)
+               res_str = showSDocForUser unqual (text str <+> dcolon <+> ppr kind)
                unqual  = icPrintUnqual (cm_ic cmstate)
 
 -----------------------------------------------------------------------------
@@ -949,7 +947,8 @@ upsweep_mod hsc_env oldUI summary1 reachable_inc_me
               | otherwise = False
 
         compresult <- compile hsc_env_strictDC this_mod location 
-                             source_unchanged have_object mb_old_iface
+                       (ms_hs_date summary1) 
+                       source_unchanged have_object mb_old_iface
 
         case compresult of