[PATCH] D141451: [clang] report inlining decisions with -Wattribute-{warning|error}
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 18 12:33:28 PST 2023
dblaikie added a comment.
In D141451#4063151 <https://reviews.llvm.org/D141451#4063151>, @nickdesaulniers wrote:
> In D141451#4045658 <https://reviews.llvm.org/D141451#4045658>, @efriedma wrote:
>
>> clang has a "LocTrackingOnly" setting for debug info, which emits DILocation info into the IR, but emits a marker into the DICompileUnit to skip emitting the .debug_info in the backend. We currently use it for -Rpass. We don't do this by default, I think to save compile time.
>
> Specifically `emissionKind: NoDebug`, example:
>
> `!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 16.0.0 (git at github.com:llvm/llvm-project.git 7b433e026498cf4176931b2407baece1d5060e16)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, splitDebugInlining: false, nameTableKind: None)`
>
> Though should the frontend be setting codegen options when parsing? Would the idea be to try to re-set `OPT_debug_info_kind_EQ` when clang codegen's IR for a function with such an attribute?
Probably turn on `emissionKind: NoDebug` whenever the warning is enabled?
> ---
>
> In D141451#4045214 <https://reviews.llvm.org/D141451#4045214>, @dblaikie wrote:
>
>> It'd be nice not to invent a new way of tracking inlining separate from the way debug info does this - duplicate systems with separate opportunities for bugs, etc. Any chance we can reuse the debug info inlining descriptions for this?
>
> So it looks like we have:
>
> `!28 = !DILocation(line: 14, column: 3, scope: !8, inlinedAt: !29)`
>
> Let me see if I can create DILocation without line or column values.
Not sure I follow - why would you want to drop line/column info? Isn't that relevant to the inlining stack - you might have multiple calls in the same function & it'd be good to know which one the diagnostic is referring to.
> The DISubprogram and DILocation should form a similar chain, even if significantly more complicated to "unwind."
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