Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type CAFSet = Set CAFLabel
- type CAFEnv = LabelMap CAFSet
- cafAnal :: LabelSet -> CLabel -> CmmGraph -> CAFEnv
- cafAnalData :: CmmStatics -> CAFSet
- doSRTs :: DynFlags -> ModuleSRTInfo -> [(CAFEnv, [CmmDecl])] -> [(CAFSet, CmmDecl)] -> IO (ModuleSRTInfo, [CmmDeclSRTs])
- data ModuleSRTInfo = ModuleSRTInfo {
- thisModule :: Module
- dedupSRTs :: Map (Set SRTEntry) SRTEntry
- flatSRTs :: Map SRTEntry (Set SRTEntry)
- moduleSRTMap :: SRTMap
- emptySRT :: Module -> ModuleSRTInfo
- type SRTMap = Map CAFLabel (Maybe SRTEntry)
- srtMapNonCAFs :: SRTMap -> NonCaffySet
Documentation
cafAnal :: LabelSet -> CLabel -> CmmGraph -> CAFEnv Source #
For each code block: - collect the references reachable from this code block to FUN, THUNK or RET labels for which hasCAF == True
This gives us a CAFEnv
: a mapping from code block to sets of labels
cafAnalData :: CmmStatics -> CAFSet Source #
doSRTs :: DynFlags -> ModuleSRTInfo -> [(CAFEnv, [CmmDecl])] -> [(CAFSet, CmmDecl)] -> IO (ModuleSRTInfo, [CmmDeclSRTs]) Source #
Attach SRTs to all info tables in the CmmDecls, and add SRT declarations to the ModuleSRTInfo.
data ModuleSRTInfo Source #
ModuleSRTInfo | |
|
Instances
Outputable ModuleSRTInfo # | |
Defined in GHC.Cmm.Info.Build |
emptySRT :: Module -> ModuleSRTInfo Source #
type SRTMap = Map CAFLabel (Maybe SRTEntry) Source #
Maps labels from cafAnal
to the final CLabel that will appear
in the SRT.
- closures with singleton SRTs resolve to their single entry
- closures with larger SRTs map to the label for that SRT
- CAFs must not map to anything!
- if a labels maps to Nothing, we found that this label's SRT
is empty, so we don't need to refer to it from other SRTs.
srtMapNonCAFs :: SRTMap -> NonCaffySet Source #
Given SRTMap
of a module, returns the set of non-CAFFY names in the
module. Any Name
s not in the set are CAFFY.