GHC.StgToCmm.TagCheck

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.StgToCmm.TagCheck

Synopsis

- emitTagAssertion :: String -> CmmExpr -> FCode ()
- emitArgTagCheck :: SDoc -> [CbvMark] -> [Id] -> FCode ()
- checkArg :: SDoc -> CbvMark -> StgArg -> FCode ()
- whenCheckTags :: FCode () -> FCode ()
- checkArgStatic :: SDoc -> StrictnessMark -> StgArg -> FCode ()
- checkFunctionArgTags :: SDoc -> Id -> [Id] -> FCode ()
- checkConArgsStatic :: SDoc -> DataCon -> [StgArg] -> FCode ()
- checkConArgsDyn :: SDoc -> DataCon -> [StgArg] -> FCode ()

# Documentation

emitTagAssertion :: String -> CmmExpr -> FCode () Source #

Call barf if we failed to predict a tag correctly. This is immensely useful when debugging issues in tag inference as it will result in a program abort when we encounter an invalid call/heap object, rather than leaving it be and segfaulting arbitrary or producing invalid results. We check if either: * A tag is present * Or the object is a 25 (for which zero is the proper tag)

emitArgTagCheck :: SDoc -> [CbvMark] -> [Id] -> FCode () Source #

checkArg :: SDoc -> CbvMark -> StgArg -> FCode () Source #

whenCheckTags :: FCode () -> FCode () Source #

checkArgStatic :: SDoc -> StrictnessMark -> StgArg -> FCode () Source #

checkFunctionArgTags :: SDoc -> Id -> [Id] -> FCode () Source #

Check all arguments marked as cbv for the presence of a tag *at runtime*.

checkConArgsStatic :: SDoc -> DataCon -> [StgArg] -> FCode () Source #

Check all required-tagged arguments of a constructor are tagged *at compile time*.

checkConArgsDyn :: SDoc -> DataCon -> [StgArg] -> FCode () Source #