GHC.Driver.GenerateCgIPEStub

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Driver.GenerateCgIPEStub

Synopsis

- generateCgIPEStub :: HscEnv -> Module -> InfoTableProvMap -> (NonCaffySet, ModuleLFInfos, Map CmmInfoTable (Maybe IpeSourceLocation), IPEStats) -> CgStream CmmGroupSRTs CmmCgInfos
- lookupEstimatedTicks :: HscEnv -> Map CmmInfoTable (Maybe IpeSourceLocation) -> IPEStats -> CmmGroupSRTs -> IO (Map CmmInfoTable (Maybe IpeSourceLocation), IPEStats)

# Documentation

generateCgIPEStub Source #

Arguments

:: HscEnv |
-> Module |
-> InfoTableProvMap | If the CmmInfoTables map refer Cmm symbols which were deterministically renamed, the info table provenance map must also be accordingly renamed.
-> (NonCaffySet, ModuleLFInfos, Map CmmInfoTable (Maybe IpeSourceLocation), IPEStats) |
-> CgStream CmmGroupSRTs CmmCgInfos |

lookupEstimatedTicks :: HscEnv -> Map CmmInfoTable (Maybe IpeSourceLocation) -> IPEStats -> CmmGroupSRTs -> IO (Map CmmInfoTable (Maybe IpeSourceLocation), IPEStats) Source #

Given: * an initial mapping from info tables to possible source locations, * initial `IPEStats`, * a `CmmGroupSRTs`,

map every info table listed in the `CmmProc`s of the group to their possible source locations and update `IPEStats` for skipped stack info tables (in case both -finfo-table-map and -fno-info-table-map-with-stack were given). See: Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)]

Note: While it would be cleaner if we could keep the recursion and accumulation internal to this function, this cannot be done without separately traversing stream of `CmmGroupSRTs` in `Main`. The initial implementation of this logic did such a thing, and code generation performance suffered considerably as a result (see #23103).