diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-31 05:46:17 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-31 05:46:17 +0000 |
commit | 28127462389fde6b62ac5a03ec81b4139a7708f3 (patch) | |
tree | 5405cfad7298f787eafe96dda33ecbeee24caefc /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 8912df12ffca0103b95e50b630961b737091d82a (diff) | |
download | bcm5719-llvm-28127462389fde6b62ac5a03ec81b4139a7708f3.tar.gz bcm5719-llvm-28127462389fde6b62ac5a03ec81b4139a7708f3.zip |
Delay adding imported entity DIEs to the lexical scope, streamlining the check for "this scope has nothing in it"
This makes the emptiness of the scope with regards to variables and
nested scopes is the same as with regards to imported entities. Just
check if we had nothing at all before we build the node.
llvm-svn: 216840
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 56ad9666e95..cfffef7e747 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -597,14 +597,14 @@ std::unique_ptr<DIE> DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU, ScopesWithImportedEntities.end(), std::pair<const MDNode *, const MDNode *>(DS, nullptr), less_first()); - if (Children.empty() && Range.first == Range.second) - return nullptr; - ScopeDIE = constructLexicalScopeDIE(TheCU, Scope); - assert(ScopeDIE && "Scope DIE should not be null."); for (ImportedEntityMap::const_iterator i = Range.first; i != Range.second; ++i) - ScopeDIE->addChild( + Children.push_back( constructImportedEntityDIE(TheCU, DIImportedEntity(i->second))); + if (Children.empty()) + return nullptr; + ScopeDIE = constructLexicalScopeDIE(TheCU, Scope); + assert(ScopeDIE && "Scope DIE should not be null."); } // Add children |