nickdesaulniers added a comment.

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 (g...@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?

---

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.  The 
DISubprogram and DILocation should form a similar chain, even if significantly 
more complicated to "unwind."



================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:2467-2468
+
+        const Function *Callee = CI->getCalledFunction();
+        if (Callee && (Callee->hasFnAttribute("dontcall-error") ||
+                       Callee->hasFnAttribute("dontcall-warn"))) {
----------------
nickdesaulniers wrote:
> arsenm wrote:
> > Misses constexpr casts and aliases
> The base feature doesn't work with aliases (or ConstantExpr), in GCC or 
> Clang.  I should perhaps fix that first...
Perhaps I should use Call.getCalledOperand()->stripPointerCasts() for 
constantexpr case.


================
Comment at: llvm/test/Transforms/Inline/dontcall-attributes.ll:8
+declare void @fof() "dontcall-error"="oh no"
+
+define void @bar(i32 %x) {
----------------
arsenm wrote:
> test alias case?
I actually disagree about aliases.  I don't think aliases should implicitly 
inherit function attributes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141451

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to