[PATCH] D14511: Emit discriminator for inlined callsites.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 09:39:13 PST 2015


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Couple of minor fixes/improvements, but looks right enough - commit when ready.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:442
@@ -441,1 +441,3 @@
   addUInt(*ScopeDIE, dwarf::DW_AT_call_line, None, IA->getLine());
+  if (IA->getDiscriminator()) {
+    addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, None, IA->getDiscriminator());
----------------
Drop {} around a single-line block (the idiomatic/prevailing style in the LLVM project, though I don't think we have it written in the style guide)

================
Comment at: test/DebugInfo/Generic/discriminator.ll:10
@@ +9,3 @@
+;static void bar() __attribute__((always_inline));
+;static void bar() { xyz(); }
+;void foo() {
----------------
Switch the attribute earlier and you can do this without the separate declaration:

  static void __attribute__((always_inline)) bar() { xyz(); }

================
Comment at: test/DebugInfo/Generic/discriminator.ll:15
@@ +14,3 @@
+
+; CHECK: DW_AT_GNU_discriminator
+
----------------
CHECK could be a bit more detailed - I'm guessing the first inlined subroutine doesn't need a discriminator, and the second does? Something like:

  CHECK: DW_TAG_inlined_subroutine
  CHECK-NOT: DW_AT_discriminator
  CHECK: DW_TAG_inlined_subroutine
  CHECK-NOT: {{DW_TAG|NULL}}
  CHECK: DW_AT_discriminator 1 



http://reviews.llvm.org/D14511





More information about the llvm-commits mailing list