mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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());
|
||||
|
Reference in New Issue
Block a user