summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-12 01:14:29 +0100
committerIan Lynagh <igloo@earth.li>2012-06-12 01:14:29 +0100
commit6f2f83800dd89af67cbf6de4d9b2afda4af0938f (patch)
tree0e357bd864d496468a315f0819fccf1abf36c316 /ghc
parent8685576a3a1802e98480d74beecf7c8450363907 (diff)
downloadhaskell-6f2f83800dd89af67cbf6de4d9b2afda4af0938f.tar.gz
Build fixes
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GhciMonad.hs6
-rw-r--r--ghc/GhciTags.hs12
-rw-r--r--ghc/InteractiveUI.hs5
3 files changed, 14 insertions, 9 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs
index 3dc69eeab2..c6eb619995 100644
--- a/ghc/GhciMonad.hs
+++ b/ghc/GhciMonad.hs
@@ -252,12 +252,14 @@ unsetOption opt
printForUser :: GhcMonad m => SDoc -> m ()
printForUser doc = do
unqual <- GHC.getPrintUnqual
- MonadUtils.liftIO $ Outputable.printForUser stdout unqual doc
+ dflags <- getDynFlags
+ MonadUtils.liftIO $ Outputable.printForUser dflags stdout unqual doc
printForUserPartWay :: SDoc -> GHCi ()
printForUserPartWay doc = do
unqual <- GHC.getPrintUnqual
- liftIO $ Outputable.printForUserPartWay stdout opt_PprUserLength unqual doc
+ dflags <- getDynFlags
+ liftIO $ Outputable.printForUserPartWay dflags stdout opt_PprUserLength unqual doc
-- | Run a single Haskell expression
runStmt :: String -> GHC.SingleStep -> GHCi (Maybe GHC.RunResult)
diff --git a/ghc/GhciTags.hs b/ghc/GhciTags.hs
index d37b93fb3f..e838269df8 100644
--- a/ghc/GhciTags.hs
+++ b/ghc/GhciTags.hs
@@ -86,12 +86,13 @@ listModuleTags m = do
case mbModInfo of
Nothing -> return []
Just mInfo -> do
+ dflags <- getDynFlags
mb_print_unqual <- GHC.mkPrintUnqualifiedForModule mInfo
let unqual = fromMaybe GHC.alwaysQualify mb_print_unqual
let names = fromMaybe [] $GHC.modInfoTopLevelScope mInfo
let localNames = filter ((m==) . nameModule) names
mbTyThings <- mapM GHC.lookupName localNames
- return $! [ tagInfo unqual exported kind name realLoc
+ return $! [ tagInfo dflags unqual exported kind name realLoc
| tyThing <- catMaybes mbTyThings
, let name = getName tyThing
, let exported = GHC.modInfoIsExportedName mInfo name
@@ -119,11 +120,12 @@ data TagInfo = TagInfo
-- get tag info, for later translation into Vim or Emacs style
-tagInfo :: PrintUnqualified -> Bool -> Char -> Name -> RealSrcLoc -> TagInfo
-tagInfo unqual exported kind name loc
+tagInfo :: DynFlags -> PrintUnqualified -> Bool -> Char -> Name -> RealSrcLoc
+ -> TagInfo
+tagInfo dflags unqual exported kind name loc
= TagInfo exported kind
- (showSDocForUser unqual $ pprOccName (nameOccName name))
- (showSDocForUser unqual $ ftext (srcLocFile loc))
+ (showSDocForUser dflags unqual $ pprOccName (nameOccName name))
+ (showSDocForUser dflags unqual $ ftext (srcLocFile loc))
(srcLocLine loc) (srcLocCol loc) Nothing
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 7e83565b1a..4e8325238e 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -961,8 +961,9 @@ info :: String -> InputT GHCi ()
info "" = ghcError (CmdLineError "syntax: ':i <thing-you-want-info-about>'")
info s = handleSourceError GHC.printException $ do
unqual <- GHC.getPrintUnqual
+ dflags <- getDynFlags
sdocs <- mapM infoThing (words s)
- mapM_ (liftIO . putStrLn . showSDocForUser unqual) sdocs
+ mapM_ (liftIO . putStrLn . showSDocForUser dflags unqual) sdocs
infoThing :: GHC.GhcMonad m => String -> m SDoc
infoThing str = do
@@ -1589,7 +1590,7 @@ browseModule bang modl exports_only = do
prettyThings = map (pretty pefas) things
prettyThings' | bang = annotate $ zip modNames prettyThings
| otherwise = prettyThings
- liftIO $ putStrLn $ showSDocForUser unqual (vcat prettyThings')
+ liftIO $ putStrLn $ showSDocForUser dflags unqual (vcat prettyThings')
-- ToDo: modInfoInstances currently throws an exception for
-- package modules. When it works, we can do this:
-- $$ vcat (map GHC.pprInstance (GHC.modInfoInstances mod_info))