summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Config.hs
blob: 12eb4e47dc6dee74d5becc7ed2274b99a8e3fd3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- | Cmm compilation configuration

{-# LANGUAGE DerivingStrategies         #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

module GHC.Cmm.Config
  ( CmmConfig(..)
  , cmmPlatform
  ) where

import GHC.Prelude

import GHC.Platform
import GHC.Platform.Profile


data CmmConfig = CmmConfig
  { cmmProfile             :: !Profile -- ^ Target Profile
  , cmmOptControlFlow      :: !Bool    -- ^ Optimize Cmm Control Flow or not
  , cmmDoLinting           :: !Bool    -- ^ Do Cmm Linting Optimization or not
  , cmmOptElimCommonBlks   :: !Bool    -- ^ Eliminate common blocks or not
  , cmmOptSink             :: !Bool    -- ^ Perform sink after stack layout or not
  , cmmGenStackUnwindInstr :: !Bool    -- ^ Generate stack unwinding instructions (for debugging)
  , cmmExternalDynamicRefs :: !Bool    -- ^ Generate code to link against dynamic libraries
  , cmmDoCmmSwitchPlans    :: !Bool    -- ^ Should the Cmm pass replace Stg switch statements
  , cmmSplitProcPoints     :: !Bool    -- ^ Should Cmm split proc points or not
  }

-- | retrieve the target Cmm platform
cmmPlatform :: CmmConfig -> Platform
cmmPlatform = profilePlatform . cmmProfile