diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-10-09 18:24:28 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-10-09 18:24:28 +0000 |
commit | 8b2fdb83c5703e97d4dce26f4b69c257f93ea77b (patch) | |
tree | d2b2fd43668fb221e14e90aa87d7b2f4f2da8a38 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 8f31f448c5aff821b134f36a3ee8e9f4ef50cbda (diff) | |
download | bcm5719-llvm-8b2fdb83c5703e97d4dce26f4b69c257f93ea77b.tar.gz bcm5719-llvm-8b2fdb83c5703e97d4dce26f4b69c257f93ea77b.zip |
Sink DwarfDebug::createScopeChildrenDIE down into DwarfCompileUnit.
llvm-svn: 219422
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 75206d2d85d..2b71f845383 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -330,31 +330,11 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) { return !getLabelAfterInsn(Ranges.front().second); } -DIE *DwarfDebug::createScopeChildrenDIE( - DwarfCompileUnit &TheCU, LexicalScope *Scope, - SmallVectorImpl<std::unique_ptr<DIE>> &Children, - unsigned *ChildScopeCount) { - DIE *ObjectPointer = nullptr; - - for (DbgVariable *DV : ScopeVariables.lookup(Scope)) - Children.push_back(TheCU.constructVariableDIE(*DV, *Scope, ObjectPointer)); - - unsigned ChildCountWithoutScopes = Children.size(); - - for (LexicalScope *LS : Scope->getChildren()) - TheCU.constructScopeDIE(LS, Children); - - if (ChildScopeCount) - *ChildScopeCount = Children.size() - ChildCountWithoutScopes; - - return ObjectPointer; -} - DIE *DwarfDebug::createAndAddScopeChildren(DwarfCompileUnit &TheCU, LexicalScope *Scope, DIE &ScopeDIE) { // We create children when the scope DIE is not null. SmallVector<std::unique_ptr<DIE>, 8> Children; - DIE *ObjectPointer = createScopeChildrenDIE(TheCU, Scope, Children); + DIE *ObjectPointer = TheCU.createScopeChildrenDIE(Scope, Children); // Add children for (auto &I : Children) @@ -1483,6 +1463,8 @@ void DwarfDebug::endFunction(const MachineFunction *MF) { assert(ScopeVariables.empty()); assert(CurrentFnArguments.empty()); assert(DbgValues.empty()); + // FIXME: This wouldn't be true in LTO with a -g (with inlining) CU followed + // by a -gmlt CU. Add a test and remove this assertion. assert(AbstractVariables.empty()); LabelsBeforeInsn.clear(); LabelsAfterInsn.clear(); |