summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/AsmUtils.hs7
-rw-r--r--compiler/utils/Outputable.hs9
2 files changed, 6 insertions, 10 deletions
diff --git a/compiler/utils/AsmUtils.hs b/compiler/utils/AsmUtils.hs
index 591b53dc31..d3393d71e2 100644
--- a/compiler/utils/AsmUtils.hs
+++ b/compiler/utils/AsmUtils.hs
@@ -12,9 +12,10 @@ import GHC.Platform
import Outputable
-- | Generate a section type (e.g. @\@progbits@). See #13937.
-sectionType :: String -- ^ section type
- -> SDoc -- ^ pretty assembler fragment
-sectionType ty = sdocWithPlatform $ \platform ->
+sectionType :: Platform -- ^ Target platform
+ -> String -- ^ section type
+ -> SDoc -- ^ pretty assembler fragment
+sectionType platform ty =
case platformArch platform of
ArchARM{} -> char '%' <> text ty
_ -> char '@' <> text ty
diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index 7133951d67..6f6a335ed7 100644
--- a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ -71,7 +71,7 @@ module Outputable (
neverQualify, neverQualifyNames, neverQualifyModules,
alwaysQualifyPackages, neverQualifyPackages,
QualifyName(..), queryQual,
- sdocWithDynFlags, sdocWithPlatform, sdocOption,
+ sdocWithDynFlags, sdocOption,
updSDocContext,
SDocContext (..), sdocWithContext,
getPprStyle, withPprStyle, setStyleColoured,
@@ -96,7 +96,7 @@ import GhcPrelude
import {-# SOURCE #-} GHC.Driver.Session
( DynFlags, hasPprDebug, hasNoDebugOutput
- , targetPlatform, pprUserLength, pprCols
+ , pprUserLength, pprCols
, unsafeGlobalDynFlags, initSDocContext
)
import {-# SOURCE #-} Module( UnitId, Module, ModuleName, moduleName )
@@ -106,7 +106,6 @@ import BufWrite (BufHandle)
import FastString
import qualified Pretty
import Util
-import GHC.Platform
import qualified PprColour as Col
import Pretty ( Doc, Mode(..) )
import Panic
@@ -346,7 +345,6 @@ data SDocContext = SDC
-- ^ True if Unicode encoding is supported
-- and not disable by GHC_NO_UNICODE environment variable
, sdocHexWordLiterals :: !Bool
- , sdocDebugLevel :: !Int
, sdocPprDebug :: !Bool
, sdocPrintUnicodeSyntax :: !Bool
, sdocPrintCaseAsLet :: !Bool
@@ -422,9 +420,6 @@ getPprStyle df = SDoc $ \ctx -> runSDoc (df (sdocStyle ctx)) ctx
sdocWithDynFlags :: (DynFlags -> SDoc) -> SDoc
sdocWithDynFlags f = SDoc $ \ctx -> runSDoc (f (sdocDynFlags ctx)) ctx
-sdocWithPlatform :: (Platform -> SDoc) -> SDoc
-sdocWithPlatform f = sdocWithDynFlags (f . targetPlatform)
-
sdocWithContext :: (SDocContext -> SDoc) -> SDoc
sdocWithContext f = SDoc $ \ctx -> runSDoc (f ctx) ctx