Sink DwarfDebug::constructLexicalScopeDIE into DwarfCompileUnit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-10-09 17:08:42 +00:00
parent 44524f4e77
commit 12a37fc6e0
4 changed files with 21 additions and 23 deletions
+17 -1
View File
@@ -376,7 +376,7 @@ void DwarfCompileUnit::constructScopeDIE(
std::make_move_iterator(Children.end()));
return;
}
ScopeDIE = DD->constructLexicalScopeDIE(*this, Scope);
ScopeDIE = constructLexicalScopeDIE(Scope);
assert(ScopeDIE && "Scope DIE should not be null.");
}
@@ -461,4 +461,20 @@ DwarfCompileUnit::constructInlinedScopeDIE(LexicalScope *Scope) {
return ScopeDIE;
}
// Construct new DW_TAG_lexical_block for this scope and attach
// DW_AT_low_pc/DW_AT_high_pc labels.
std::unique_ptr<DIE>
DwarfCompileUnit::constructLexicalScopeDIE(LexicalScope *Scope) {
if (DD->isLexicalScopeDIENull(Scope))
return nullptr;
auto ScopeDIE = make_unique<DIE>(dwarf::DW_TAG_lexical_block);
if (Scope->isAbstractScope())
return ScopeDIE;
attachRangesOrLowHighPC(*ScopeDIE, Scope->getRanges());
return ScopeDIE;
}
} // end llvm namespace