LexicalScope *Parent;
DILexicalBlock Scope(ScopeNode);
- if (Scope.isLexicalBlock()) {
- DILexicalBlock PB(Scope.getContext());
- Parent = getOrCreateInlinedScope(PB, InlinedAt);
- } else
+ if (Scope.isSubprogram())
Parent = getOrCreateLexicalScope(DebugLoc::getFromDILocation(InlinedAt));
+ else
+ Parent = getOrCreateInlinedScope(Scope.getContext(), InlinedAt);
// FIXME: Use forward_as_tuple instead of make_tuple, once MSVC2012
// compatibility is no longer required.
DIDescriptor Scope(N);
if (Scope.isLexicalBlockFile())
Scope = DILexicalBlockFile(Scope).getScope();
- auto I = AbstractScopeMap.find(N);
+ auto I = AbstractScopeMap.find(Scope);
if (I != AbstractScopeMap.end())
return &I->second;
LexicalScope *Parent = nullptr;
if (Scope.isLexicalBlock()) {
- DILexicalBlock DB(N);
+ DILexicalBlock DB(Scope);
DIDescriptor ParentDesc = DB.getContext();
Parent = getOrCreateAbstractScope(ParentDesc);
}
I = AbstractScopeMap.emplace(std::piecewise_construct,
- std::forward_as_tuple(N),
- std::forward_as_tuple(Parent, DIDescriptor(N),
+ std::forward_as_tuple(Scope),
+ std::forward_as_tuple(Parent, Scope,
nullptr, true)).first;
- if (DIDescriptor(N).isSubprogram())
+ if (Scope.isSubprogram())
AbstractScopesList.push_back(&I->second);
return &I->second;
}