[PATCH] D141451: [clang] report inlining decisions with -Wattribute-{warning|error}

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 15:23:53 PST 2023


efriedma added a comment.

There are two different approaches we use for getting source locations for diagnostics coming out of the backend; either embedding clang SourceLocations into IR, or trying to translate DWARF locations.  The advantage of using clang SourceLocations is that we never lose any fidelity, even in complex cases involving the preprocessor, and the compiler doesn't have to spend time generating complete DWARF info.  The advantage of DWARF, of course, is that it's existing, mature infrastructure.

We use clang SourceLocations for inline asm and for the warning/error attributes, we use DWARF for optimization remarks.

There's probably some argument for using DWARF here.

----

Am I reading the correctly, that currently the inlining notes don't have source locations?  That's not very friendly (particularly for display in IDEs).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141451/new/

https://reviews.llvm.org/D141451



More information about the cfe-commits mailing list