module GHC.Stg.Debug.Types where
import GHC.Prelude
import GHC.Data.FastString
import GHC.Types.SrcLoc
import Data.Set (Set)
import qualified Data.Set as Set
data SpanWithLabel = SpanWithLabel RealSrcSpan LexicalFastString
data StgDebugOpts = StgDebugOpts
{ StgDebugOpts -> Bool
stgDebug_infoTableMap :: !Bool
, StgDebugOpts -> StgDebugDctConfig
stgDebug_distinctConstructorTables :: !StgDebugDctConfig
}
data StgDebugDctConfig =
All
| Only !(Set String)
| None
dctConfigOnly :: StgDebugDctConfig -> Set String -> StgDebugDctConfig
dctConfigOnly :: StgDebugDctConfig -> Set String -> StgDebugDctConfig
dctConfigOnly StgDebugDctConfig
cfg Set String
cs
| Set String -> Bool
forall a. Set a -> Bool
Set.null Set String
cs = StgDebugDctConfig
All
| Bool
otherwise =
case StgDebugDctConfig
cfg of
StgDebugDctConfig
All -> Set String -> StgDebugDctConfig
Only Set String
cs
Only Set String
cs' -> Set String -> StgDebugDctConfig
Only (Set String -> StgDebugDctConfig)
-> Set String -> StgDebugDctConfig
forall a b. (a -> b) -> a -> b
$ Set String -> Set String -> Set String
forall a. Ord a => Set a -> Set a -> Set a
Set.union Set String
cs' Set String
cs
StgDebugDctConfig
None -> Set String -> StgDebugDctConfig
Only Set String
cs