Dynflags refactoring V (#17957)
More work towards avoiding DynFlags use (cf #17957). Commit messages:
-
CmmToAsm DynFlags refactoring
-
Remove
DynFlags
parameter fromisDynLinkName
:isDynLinkName
used to test the globalExternalDynamicRefs
flag. Now we test it outside ofisDynLinkName
-
Add new fields into
NCGConfig
: current unit id, sse/bmi versions, externalDynamicRefs, etc. -
Replace many uses of
DynFlags
byNCGConfig
-
Moved
BMI/SSE
datatypes intoGHC.Platform
-
-
Avoid
sdocWithDynFlags
inpprCLbl
- add a
DynFlags
parameter topprCLbl
- put
maybe_underscore
andpprAsmCLbl
in awhere
clause to avoidDynFlags
parameters
- add a
-
Avoid using sdocWithDynFlags
Remove one use of
sdocWithDynFlags
fromGHC.CmmToLlvm.llvmCodeGen'
and fromGHC.Driver.CodeOutput.profilingInitCode
-
Avoid DynFlags in Ppr code
-
replace
DynFlags
parameters withSDocContext
parameters for a few Ppr related functions:bufLeftRenderSDoc
,printSDoc
,printSDocLn
,showSDocOneLine
. -
remove the use of
pprCols :: DynFlags -> Int
in Outputable. We already have the information viasdocLineLength :: SDocContext -> Int
-
-
GHC.Runtime: avoid DynFlags
- add
getPlatform :: TcM Platform
helper - remove unused
DynFlags
parameter fromemptyPLS
- add
-
Use ParserFlags in GHC.Runtime.Eval
Instead of passing
DynFlags
to functions such asisStmt
andhasImport
inGHC.Runtime.Eval
we passParserFlags
. It's a much simpler structure that can be created purely withmkParserFlags'
.