module GHC.Driver.Config.Cmm.Parser
  ( initCmmParserConfig
  ) where

import GHC.Cmm.Parser.Config

import GHC.Driver.Config.Parser
import GHC.Driver.Config.StgToCmm
import GHC.Driver.Session

import GHC.Utils.Panic

initPDConfig :: DynFlags -> PDConfig
initPDConfig :: DynFlags -> PDConfig
initPDConfig DynFlags
dflags = PDConfig
  { pdProfile :: Profile
pdProfile = DynFlags -> Profile
targetProfile DynFlags
dflags
  , pdSanitizeAlignment :: Bool
pdSanitizeAlignment = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_AlignmentSanitisation DynFlags
dflags
  }

initCmmParserConfig :: DynFlags -> CmmParserConfig
initCmmParserConfig :: DynFlags -> CmmParserConfig
initCmmParserConfig DynFlags
dflags = CmmParserConfig
  { cmmpParserOpts :: ParserOpts
cmmpParserOpts = DynFlags -> ParserOpts
initParserOpts DynFlags
dflags
  , cmmpPDConfig :: PDConfig
cmmpPDConfig = DynFlags -> PDConfig
initPDConfig DynFlags
dflags
  , cmmpStgToCmmConfig :: StgToCmmConfig
cmmpStgToCmmConfig = DynFlags -> Module -> StgToCmmConfig
initStgToCmmConfig DynFlags
dflags (String -> Module
forall a. HasCallStack => String -> a
panic String
"initCmmParserConfig: no module")
  }