[clang] [Clang][Diagnose] New feature: Nested/Indented diagnostic message in sarif mode. (PR #174106)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 1 08:25:27 PST 2026


Sirraide wrote:

> The exact nesting information can only be obtained at the point where a diagnostic is constructed — which always corresponds to an AST / Sema call-stack depth. Even if we modify DiagnosticsEngine, we still wouldn’t have access to the precise nesting structure.

Yeah, maybe I phrased it poorly but this is more or less what I meant: if we want to support nested diagnostics, we need to 
1. somehow encode that nesting information in the actual diagnostics that get sent to the various consumers;
2. make use of that information when we render the diagnostic (to the terminal, sarif, etc.);
3. update all of the places where we issue a diagnostic to actually provide nesting information (this is the tedious part)

https://github.com/llvm/llvm-project/pull/174106


More information about the cfe-commits mailing list