This fixes a bug where DW_AT_abstract_origin is being emitted twice for the same subprogram if a function is both inlined and emitted in the same translation unit, by restoring the pre-r266446 behavior.
Diff Detail
Event Timeline
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | ||
---|---|---|
525 | Do we need the extra data structure? How did this code work before the CU<>Subprogram inversion? | |
test/DebugInfo/X86/abstract_origin.ll | ||
3 | 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). | |
5 | Unintentional blank line here? |
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | ||
---|---|---|
525 | Ok, this is a really good question. There is no evidence for this code existing prior to the CU<>Subprogram inversion and the test suite still passes after removing it. |
LGTM.
You may commit once you fix the test as David suggested and use the attribute((always_inline)).
Regards,
Amjad
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | ||
---|---|---|
525 | This change seems to be correct. |
Do we need the extra data structure? How did this code work before the CU<>Subprogram inversion?