[PATCH] D20072: Prevent DW_AT_abstract_origin from being emitted twice for the same subprogram

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 11:56:09 PDT 2016


dblaikie added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:525
@@ -524,2 +524,3 @@
 void DwarfDebug::finishSubprogramDefinitions() {
+  SmallPtrSet<const MDNode *, 16> FinalizedSPNodes;
   for (auto &F : MMI->getModule()->functions())
----------------
Do we need the extra data structure? How did this code work before the CU<>Subprogram inversion?

================
Comment at: test/DebugInfo/X86/abstract_origin.ll:2
@@ +1,3 @@
+; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+; Generated at -O2 from:
+;   int bar(int x) {
----------------
Simplify the test case - remove the parameters and return value and use __attribute__((alwaysinline)) (I never remember how to spell that attribute name..)

Should be simple enough to just use:

  void f1();
  __attribute__((alwaysinline)) void f2() {
    f1();
  }
  void f3() {
    f2();
  }

Even at -O0 it should produce the same/desired code (an inlined function and a non-inline version).

================
Comment at: test/DebugInfo/X86/abstract_origin.ll:4
@@ +3,3 @@
+;   int bar(int x) {
+;    
+;     return x+1;
----------------
Unintentional blank line here?


http://reviews.llvm.org/D20072





More information about the llvm-commits mailing list