summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/LexicalScopes.cpp10
-rw-r--r--llvm/test/DebugInfo/inline-scopes.ll3
2 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LexicalScopes.cpp b/llvm/lib/CodeGen/LexicalScopes.cpp
index d965968fb49..d12c234bf3b 100644
--- a/llvm/lib/CodeGen/LexicalScopes.cpp
+++ b/llvm/lib/CodeGen/LexicalScopes.cpp
@@ -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;
}
diff --git a/llvm/test/DebugInfo/inline-scopes.ll b/llvm/test/DebugInfo/inline-scopes.ll
index 310b0404f87..36c073516c5 100644
--- a/llvm/test/DebugInfo/inline-scopes.ll
+++ b/llvm/test/DebugInfo/inline-scopes.ll
@@ -32,6 +32,9 @@
; Ensure that file changes don't interfere with creating inlined subroutines.
; (see the line directive inside 'f2' in thesource)
; CHECK: DW_TAG_inlined_subroutine
+; CHECK: DW_TAG_variable
+; CHECK-NOT: DW_TAG
+; CHECK: DW_AT_abstract_origin
; Function Attrs: uwtable
define i32 @main() #0 {
OpenPOWER on IntegriCloud