module GHC.Driver.Config.HsToCore
  ( initBangOpts
  )
where

import GHC.Types.Id.Make
import GHC.Driver.Session
import qualified GHC.LanguageExtensions as LangExt

initBangOpts :: DynFlags -> BangOpts
initBangOpts :: DynFlags -> BangOpts
initBangOpts DynFlags
dflags = BangOpts
  { bang_opt_strict_data :: Bool
bang_opt_strict_data   = Extension -> DynFlags -> Bool
xopt Extension
LangExt.StrictData DynFlags
dflags
  , bang_opt_unbox_disable :: Bool
bang_opt_unbox_disable = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_OmitInterfacePragmas DynFlags
dflags
      -- Don't unbox if we aren't optimising; rather arbitrarily,
      -- we use -fomit-iface-pragmas as the indication
  , bang_opt_unbox_strict :: Bool
bang_opt_unbox_strict  = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_UnboxStrictFields DynFlags
dflags
  , bang_opt_unbox_small :: Bool
bang_opt_unbox_small   = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_UnboxSmallStrictFields DynFlags
dflags
  }