Justin Stitt f9ad232421
[Clang] Show inlining hints for __attribute__((warning/error)) (#174892)
When functions marked with `[[gnu::warning/error]]` are called through inlined functions, we now show the inlining chain that led to the call when ``-fdiagnostics-show-inlining-chain`` is enabled.

With this flag, two modes are possible:

- **heuristic** mode: Uses `srcloc` and `inlined.from` metadata to reconstruct the inlining chain. Functions that are `inline`, `static`, `always_inline`, or in anonymous namespaces get `srcloc` metadata attached. This mode emits a note suggesting `-gline-directives-only` for more accurate locations.

- **debug** mode: Automatically used instead of heuristic when building with at least `-gline-directives-only` (implied by `-g1` or higher). Leverages `DILocation` debug info for reliable source locations.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1571
2026-03-27 13:52:31 -07:00
..
2025-03-29 20:54:15 +01:00

See llvm/docs/README.txt