mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
DebugInfo: Fix inlining with #file directives a little harder
Seems my previous fix was insufficient - we were still not adding the inlined function to the abstract scope list. Which meant it wasn't flagged as inline, didn't have nested lexical scopes in the abstract definition, and didn't have abstract variables - so the inlined variable didn't reference an abstract variable, instead being described completely inline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -210,21 +210,21 @@ LexicalScope *LexicalScopes::getOrCreateAbstractScope(const MDNode *N) {
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user