diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-06-04 23:50:52 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-06-04 23:50:52 +0000 |
commit | 36408e75696d97ccf0e054335c5beb29843183fe (patch) | |
tree | 830903249045976b82a6a7563629cccc07e7d5db /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | 4244ea9ca13926d65ddeb79f1b72331ddede0ab1 (diff) | |
download | bcm5719-llvm-36408e75696d97ccf0e054335c5beb29843183fe.tar.gz bcm5719-llvm-36408e75696d97ccf0e054335c5beb29843183fe.zip |
DebugInfo: Reapply r209984 (reverted in r210143), asserting that abstract DbgVariables have DIEs.
Abstract variables within abstract scopes that are entirely optimized
away in their first inlining are omitted because their scope is not
present so the variable is never created. Instead, we should ensure the
scope is created so the variable can be added, even if it's been
optimized away in its first inlining.
This fixes the incorrect debug info in missing-abstract-variable.ll
(added in r210143) and passes an asserts self-hosting build, so
hopefully there's not more of these issues left behind... *fingers
crossed*.
llvm-svn: 210221
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 2325ab8444e..0bac3bec389 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1782,12 +1782,10 @@ std::unique_ptr<DIE> DwarfUnit::constructVariableDIEImpl(const DbgVariable &DV, // Define variable debug information entry. auto VariableDie = make_unique<DIE>(DV.getTag()); DbgVariable *AbsVar = DV.getAbstractVariable(); - // FIXME: any missing abstract variable missing a DIE will result in incorrect - // DWARF. More details in test/DebugInfo/missing-abstract-variable.ll for an - // example of why this is happening. - if (AbsVar && AbsVar->getDIE()) + if (AbsVar) { + assert(AbsVar->getDIE()); addDIEEntry(*VariableDie, dwarf::DW_AT_abstract_origin, *AbsVar->getDIE()); - else { + } else { if (!Name.empty()) addString(*VariableDie, dwarf::DW_AT_name, Name); addSourceLine(*VariableDie, DV.getVariable()); |