diff options
author | John Ericson <git@JohnEricson.me> | 2019-05-21 23:00:27 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-29 16:06:45 -0400 |
commit | bfccd832782353a000b430870a6602cc591c8b7a (patch) | |
tree | 499d224a8aa6f8adb5dc2b726f7726b6409b8c41 /compiler/cmm | |
parent | ace2e3350fa7da1f7ebcdb882f1241da10a90c26 (diff) | |
download | haskell-bfccd832782353a000b430870a6602cc591c8b7a.tar.gz |
Inline `Settings` into `DynFlags`
After the previous commit, `Settings` is just a thin wrapper around
other groups of settings. While `Settings` is used by GHC-the-executable
to initalize `DynFlags`, in principle another consumer of
GHC-the-library could initialize `DynFlags` a different way. It
therefore doesn't make sense for `DynFlags` itself (library code) to
separate the settings that typically come from `Settings` from the
settings that typically don't.
Diffstat (limited to 'compiler/cmm')
-rw-r--r-- | compiler/cmm/CLabel.hs | 14 | ||||
-rw-r--r-- | compiler/cmm/CmmInfo.hs | 2 | ||||
-rw-r--r-- | compiler/cmm/CmmType.hs | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index fddb063185..d30bd4c0f7 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -1162,7 +1162,7 @@ pprCLabel dynFlags (AsmTempLabel u) = tempLabelPrefixOrUnderscore <> pprUniqueAlways u pprCLabel dynFlags (AsmTempDerivedLabel l suf) - | sGhcWithNativeCodeGen $ settings dynFlags + | platformMisc_ghcWithNativeCodeGen $ platformMisc dynFlags = ptext (asmTempLabelPrefix $ targetPlatform dynFlags) <> case l of AsmTempLabel u -> pprUniqueAlways u LocalBlockLabel u -> pprUniqueAlways u @@ -1170,15 +1170,15 @@ pprCLabel dynFlags (AsmTempDerivedLabel l suf) <> ftext suf pprCLabel dynFlags (DynamicLinkerLabel info lbl) - | sGhcWithNativeCodeGen $ settings dynFlags + | platformMisc_ghcWithNativeCodeGen $ platformMisc dynFlags = pprDynamicLinkerAsmLabel (targetPlatform dynFlags) info lbl pprCLabel dynFlags PicBaseLabel - | sGhcWithNativeCodeGen $ settings dynFlags + | platformMisc_ghcWithNativeCodeGen $ platformMisc dynFlags = text "1b" pprCLabel dynFlags (DeadStripPreventer lbl) - | sGhcWithNativeCodeGen $ settings dynFlags + | platformMisc_ghcWithNativeCodeGen $ platformMisc dynFlags = {- `lbl` can be temp one but we need to ensure that dsp label will stay @@ -1190,18 +1190,18 @@ pprCLabel dynFlags (DeadStripPreventer lbl) <> pprCLabel dynFlags lbl <> text "_dsp" pprCLabel dynFlags (StringLitLabel u) - | sGhcWithNativeCodeGen $ settings dynFlags + | platformMisc_ghcWithNativeCodeGen $ platformMisc dynFlags = pprUniqueAlways u <> ptext (sLit "_str") pprCLabel dynFlags lbl = getPprStyle $ \ sty -> - if sGhcWithNativeCodeGen (settings dynFlags) && asmStyle sty + if platformMisc_ghcWithNativeCodeGen (platformMisc dynFlags) && asmStyle sty then maybe_underscore dynFlags $ pprAsmCLbl (targetPlatform dynFlags) lbl else pprCLbl lbl maybe_underscore :: DynFlags -> SDoc -> SDoc maybe_underscore dynFlags doc = - if sLeadingUnderscore $ settings dynFlags + if platformMisc_leadingUnderscore $ platformMisc dynFlags then pp_cSEP <> doc else doc diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs index 345f3facaa..c374e9fd81 100644 --- a/compiler/cmm/CmmInfo.hs +++ b/compiler/cmm/CmmInfo.hs @@ -531,7 +531,7 @@ funInfoArity dflags iptr | otherwise = ( pc_REP_StgFunInfoExtraFwd_arity pc , oFFSET_StgFunInfoExtraFwd_arity dflags ) - pc = sPlatformConstants (settings dflags) + pc = platformConstants dflags ----------------------------------------------------------------------------- -- diff --git a/compiler/cmm/CmmType.hs b/compiler/cmm/CmmType.hs index 276fbff534..43d23c7ee7 100644 --- a/compiler/cmm/CmmType.hs +++ b/compiler/cmm/CmmType.hs @@ -335,22 +335,22 @@ data ForeignHint rEP_CostCentreStack_mem_alloc :: DynFlags -> CmmType rEP_CostCentreStack_mem_alloc dflags = cmmBits (widthFromBytes (pc_REP_CostCentreStack_mem_alloc pc)) - where pc = sPlatformConstants (settings dflags) + where pc = platformConstants dflags rEP_CostCentreStack_scc_count :: DynFlags -> CmmType rEP_CostCentreStack_scc_count dflags = cmmBits (widthFromBytes (pc_REP_CostCentreStack_scc_count pc)) - where pc = sPlatformConstants (settings dflags) + where pc = platformConstants dflags rEP_StgEntCounter_allocs :: DynFlags -> CmmType rEP_StgEntCounter_allocs dflags = cmmBits (widthFromBytes (pc_REP_StgEntCounter_allocs pc)) - where pc = sPlatformConstants (settings dflags) + where pc = platformConstants dflags rEP_StgEntCounter_allocd :: DynFlags -> CmmType rEP_StgEntCounter_allocd dflags = cmmBits (widthFromBytes (pc_REP_StgEntCounter_allocd pc)) - where pc = sPlatformConstants (settings dflags) + where pc = platformConstants dflags ------------------------------------------------------------------------- {- Note [Signed vs unsigned] |