module GHC.Driver.Config.StgToJS
  ( initStgToJSConfig
  )
where

import GHC.StgToJS.Types

import GHC.Driver.Session
import GHC.Platform.Ways
import GHC.Utils.Outputable

import GHC.Prelude

-- | Initialize StgToJS settings from DynFlags
initStgToJSConfig :: DynFlags -> StgToJSConfig
initStgToJSConfig :: DynFlags -> StgToJSConfig
initStgToJSConfig DynFlags
dflags = StgToJSConfig
  -- flags
  { csInlinePush :: Bool
csInlinePush      = Bool
False
  , csInlineBlackhole :: Bool
csInlineBlackhole = Bool
False
  , csInlineLoadRegs :: Bool
csInlineLoadRegs  = Bool
False
  , csInlineEnter :: Bool
csInlineEnter     = Bool
False
  , csInlineAlloc :: Bool
csInlineAlloc     = Bool
False
  , csTraceRts :: Bool
csTraceRts        = Bool
False
  , csAssertRts :: Bool
csAssertRts       = Bool
False
  , csBoundsCheck :: Bool
csBoundsCheck     = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_DoBoundsChecking DynFlags
dflags
  , csDebugAlloc :: Bool
csDebugAlloc      = Bool
False
  , csTraceForeign :: Bool
csTraceForeign    = Bool
False
  , csProf :: Bool
csProf            = DynFlags -> Ways
ways DynFlags
dflags Ways -> Way -> Bool
`hasWay` Way
WayProf
  , csRuntimeAssert :: Bool
csRuntimeAssert   = Bool
False
  -- settings
  , csContext :: SDocContext
csContext         = DynFlags -> PprStyle -> SDocContext
initSDocContext DynFlags
dflags PprStyle
defaultDumpStyle
  }