diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-18 11:56:42 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-23 20:43:48 -0400 |
commit | a584366b1d363039247f73f6dcdd3514994ad600 (patch) | |
tree | 4c47f97c0a705ccfcce29e9ece93a3d666448488 | |
parent | 667d63558a694e12974ace723b553950f6080365 (diff) | |
download | haskell-a584366b1d363039247f73f6dcdd3514994ad600.tar.gz |
Remove sdocWithDynFlags (fix #10143)
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/Utils/Outputable.hs | 13 |
2 files changed, 2 insertions, 12 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 7cab547af2..9c5864b4c1 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -5094,7 +5094,6 @@ initSDocContext dflags style = SDC , sdocLinearTypes = xopt LangExt.LinearTypes dflags , sdocPrintTypeAbbreviations = True , sdocUnitIdForUser = ftext - , sdocDynFlags = dflags } -- | Initialize the pretty-printing options using the default user style diff --git a/compiler/GHC/Utils/Outputable.hs b/compiler/GHC/Utils/Outputable.hs index c0537e4dc0..5c337fd5b4 100644 --- a/compiler/GHC/Utils/Outputable.hs +++ b/compiler/GHC/Utils/Outputable.hs @@ -75,7 +75,7 @@ module GHC.Utils.Outputable ( neverQualify, neverQualifyNames, neverQualifyModules, alwaysQualifyPackages, neverQualifyPackages, QualifyName(..), queryQual, - sdocWithDynFlags, sdocOption, + sdocOption, updSDocContext, SDocContext (..), sdocWithContext, defaultSDocContext, getPprStyle, withPprStyle, setStyleColoured, @@ -92,7 +92,6 @@ module GHC.Utils.Outputable ( import GHC.Prelude -import {-# SOURCE #-} GHC.Driver.Session ( DynFlags ) import {-# SOURCE #-} GHC.Unit.Types ( Unit, Module, moduleName ) import {-# SOURCE #-} GHC.Unit.Module.Name( ModuleName ) import {-# SOURCE #-} GHC.Types.Name.Occurrence( OccName ) @@ -384,8 +383,6 @@ data SDocContext = SDC -- -- Note that we use `FastString` instead of `UnitId` to avoid boring -- module inter-dependency issues. - - , sdocDynFlags :: DynFlags -- TODO: remove (see Note [The OutputableP class]) } instance IsString SDoc where @@ -433,7 +430,6 @@ defaultSDocContext = SDC , sdocLinearTypes = False , sdocPrintTypeAbbreviations = True , sdocUnitIdForUser = ftext - , sdocDynFlags = error "defaultSDocContext: DynFlags not available" } withPprStyle :: PprStyle -> SDoc -> SDoc @@ -481,9 +477,6 @@ pprSetDepth depth doc = SDoc $ \ctx -> getPprStyle :: (PprStyle -> SDoc) -> SDoc getPprStyle df = SDoc $ \ctx -> runSDoc (df (sdocStyle ctx)) ctx -sdocWithDynFlags :: (DynFlags -> SDoc) -> SDoc -sdocWithDynFlags f = SDoc $ \ctx -> runSDoc (f (sdocDynFlags ctx)) ctx - sdocWithContext :: (SDocContext -> SDoc) -> SDoc sdocWithContext f = SDoc $ \ctx -> runSDoc (f ctx) ctx @@ -972,9 +965,7 @@ instance Outputable Extension where -- * selected backend: to display CLabel as C labels or Asm labels -- -- In fact the whole compiler session state that is DynFlags was passed in --- SDocContext and these values were retrieved from it. (At the time of writing, --- a DynFlags field is still present into SDocContext but hopefully it shouldn't --- last long). +-- SDocContext and these values were retrieved from it. -- -- The Outputable class makes SDoc creation easy for many values by providing -- the ppr method: |