clang 22.0.0git
DiagnosticBuilder Class Reference

Class to make it convenient to initialize TrapReason objects which can be used to attach the "trap reason" to trap instructions. More...

Detailed Description

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.

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.

{
TrapReason TR;
CGM.BuildTrapReason(diag::trap_diagnostic, TR) << 0 << SomeExpr;
consume(&TR);
}

The documentation for this class was generated from the following file: