forked from OSchip/llvm-project
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
This commit is contained in:
parent
8912df12ff
commit
2812746238
|
@ -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)
|
||||
for (ImportedEntityMap::const_iterator i = Range.first; i != Range.second;
|
||||
++i)
|
||||
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.");
|
||||
for (ImportedEntityMap::const_iterator i = Range.first; i != Range.second;
|
||||
++i)
|
||||
ScopeDIE->addChild(
|
||||
constructImportedEntityDIE(TheCU, DIImportedEntity(i->second)));
|
||||
}
|
||||
|
||||
// Add children
|
||||
|
|
Loading…
Reference in New Issue