diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-06-26 12:58:02 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-12 03:50:12 -0400 |
commit | accbc242e555822a2060091af7188ce6e9b0144e (patch) | |
tree | 641ced97452a46a0ff17f6754d2150e283c9b9ca /ghc/GHCi/UI | |
parent | f1088b3f31ceddf918a319c97557fb1f08a9a387 (diff) | |
download | haskell-accbc242e555822a2060091af7188ce6e9b0144e.tar.gz |
DynFlags: disentangle Outputable
- put panic related functions into GHC.Utils.Panic
- put trace related functions using DynFlags in GHC.Driver.Ppr
One step closer making Outputable fully independent of DynFlags.
Bump haddock submodule
Diffstat (limited to 'ghc/GHCi/UI')
-rw-r--r-- | ghc/GHCi/UI/Info.hs | 1 | ||||
-rw-r--r-- | ghc/GHCi/UI/Monad.hs | 16 | ||||
-rw-r--r-- | ghc/GHCi/UI/Tags.hs | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs index 2b035e4428..7466a28ce8 100644 --- a/ghc/GHCi/UI/Info.hs +++ b/ghc/GHCi/UI/Info.hs @@ -38,6 +38,7 @@ import GHC.Driver.Session (HasDynFlags(..)) import GHC.Data.FastString import GHC import GHC.Driver.Monad +import GHC.Driver.Ppr import GHC.Types.Name import GHC.Types.Name.Set import GHC.Utils.Outputable diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs index 63f330d86c..8c5baeee90 100644 --- a/ghc/GHCi/UI/Monad.hs +++ b/ghc/GHCi/UI/Monad.hs @@ -38,8 +38,8 @@ module GHCi.UI.Monad ( import GHCi.UI.Info (ModInfo) import qualified GHC import GHC.Driver.Monad hiding (liftIO) -import GHC.Utils.Outputable hiding (printForUser) -import qualified GHC.Utils.Outputable as Outputable +import GHC.Utils.Outputable +import qualified GHC.Driver.Ppr as Ppr import GHC.Types.Name.Occurrence import GHC.Driver.Session import GHC.Data.FastString @@ -235,7 +235,7 @@ prettyLocations locs = instance Outputable BreakLocation where ppr loc = (ppr $ breakModule loc) <+> ppr (breakLoc loc) <+> pprEnaDisa <+> if null (onBreakCmd loc) - then Outputable.empty + then empty else doubleQuotes (text (onBreakCmd loc)) where pprEnaDisa = case breakEnabled loc of True -> text "enabled" @@ -331,26 +331,26 @@ unsetOption opt printForUserNeverQualify :: GhcMonad m => SDoc -> m () printForUserNeverQualify doc = do dflags <- getDynFlags - liftIO $ Outputable.printForUser dflags stdout neverQualify AllTheWay doc + liftIO $ Ppr.printForUser dflags stdout neverQualify AllTheWay doc printForUserModInfo :: GhcMonad m => GHC.ModuleInfo -> SDoc -> m () printForUserModInfo info doc = do dflags <- getDynFlags mUnqual <- GHC.mkPrintUnqualifiedForModule info unqual <- maybe GHC.getPrintUnqual return mUnqual - liftIO $ Outputable.printForUser dflags stdout unqual AllTheWay doc + liftIO $ Ppr.printForUser dflags stdout unqual AllTheWay doc printForUser :: GhcMonad m => SDoc -> m () printForUser doc = do unqual <- GHC.getPrintUnqual dflags <- getDynFlags - liftIO $ Outputable.printForUser dflags stdout unqual AllTheWay doc + liftIO $ Ppr.printForUser dflags stdout unqual AllTheWay doc printForUserPartWay :: GhcMonad m => SDoc -> m () printForUserPartWay doc = do unqual <- GHC.getPrintUnqual dflags <- getDynFlags - liftIO $ Outputable.printForUser dflags stdout unqual Outputable.DefaultDepth doc + liftIO $ Ppr.printForUser dflags stdout unqual DefaultDepth doc -- | Run a single Haskell expression runStmt @@ -438,7 +438,7 @@ runWithStats getAllocs action = do printStats :: DynFlags -> ActionStats -> IO () printStats dflags ActionStats{actionAllocs = mallocs, actionElapsedTime = secs} = do let secs_str = showFFloat (Just 2) secs - putStrLn (showSDoc dflags ( + putStrLn (Ppr.showSDoc dflags ( parens (text (secs_str "") <+> text "secs" <> comma <+> case mallocs of Nothing -> empty diff --git a/ghc/GHCi/UI/Tags.hs b/ghc/GHCi/UI/Tags.hs index 9f4dfa6e53..bc86f39766 100644 --- a/ghc/GHCi/UI/Tags.hs +++ b/ghc/GHCi/UI/Tags.hs @@ -31,6 +31,7 @@ import Data.List import Data.Maybe import Data.Ord import GHC.Driver.Phases +import GHC.Driver.Ppr import GHC.Utils.Panic import Prelude import System.Directory |