diff options
author | Andre Marianiello <andremarianiello@users.noreply.github.com> | 2022-05-05 20:40:31 -0400 |
---|---|---|
committer | andremarianiello <andre.marianiello@gmail.com> | 2022-05-12 02:15:48 +0000 |
commit | a2dcad4e6f75c08aacc5902a20ca4c773819d7b7 (patch) | |
tree | df82d9f998dc5c8d9454479d5e6682496d6fc813 /compiler/GHC/Driver/Config | |
parent | 2c00a8d0ba4bc37e212a723fc025f83c471986c5 (diff) | |
download | haskell-a2dcad4e6f75c08aacc5902a20ca4c773819d7b7.tar.gz |
Decouple dynflags in Cmm parser (related to #17957)
Diffstat (limited to 'compiler/GHC/Driver/Config')
-rw-r--r-- | compiler/GHC/Driver/Config/Cmm/Parser.hs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Config/Cmm/Parser.hs b/compiler/GHC/Driver/Config/Cmm/Parser.hs new file mode 100644 index 0000000000..3749bfd87c --- /dev/null +++ b/compiler/GHC/Driver/Config/Cmm/Parser.hs @@ -0,0 +1,27 @@ +module GHC.Driver.Config.Cmm.Parser + ( initCmmParserConfig + ) where + +import GHC.Cmm.Parser +import GHC.Cmm.Parser.Monad + +import GHC.Driver.Config.Parser +import GHC.Driver.Config.StgToCmm +import GHC.Driver.Session + +import GHC.Unit.Types + + +initPDConfig :: DynFlags -> PDConfig +initPDConfig dflags = PDConfig + { pdProfile = targetProfile dflags + , pdSanitizeAlignment = gopt Opt_AlignmentSanitisation dflags + } + +initCmmParserConfig :: DynFlags -> Module -> CmmParserConfig +initCmmParserConfig dflags mod = CmmParserConfig + { cmmpParserOpts = initParserOpts dflags + , cmmpPDConfig = initPDConfig dflags + , cmmpStgToCmmConfig = initStgToCmmConfig dflags mod + } + |