clang 22.0.0git
|
Class to make it convenient to initialize TrapReason objects which can be used to attach the "trap reason" to trap instructions. More...
Class to make it convenient to initialize TrapReason objects which can be used to attach the "trap reason" to trap instructions.
Although this class inherits from slightly different semantics.
DiagnosticTrapKinds.td
).TrapReasonBuilder
does not emit diagnostics to the normal diagnostics consumers on destruction like normal Diagnostic builders. Instead on destruction it assigns to the TrapReason object passed into the constructor.Given that this class inherits from DiagnosticBuilder
it inherits all of its abilities to format diagnostic messages and consume various types in class (e.g. Type, Exprs, etc.). This makes it particularly suited to printing types and expressions from the AST while codegen-ing runtime checks.
Example use via the CodeGenModule::BuildTrapReason
helper.