diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-05-16 23:46:10 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-05-16 23:46:10 +0000 |
commit | 90199139dcd767a3bfc488590a8b27145bce7766 (patch) | |
tree | 9140a742de71a0ec0ad1f485a17ed53468a73fc3 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 3f318c863b1bb1a66c4683f79cbcdcc018b1462d (diff) |
Fix scope of namespaced DISubprograms when the function definition is out-of-line.
This fixes a regression introduced in r302915.
Using the lexical decl context is not necessary here for what r302915
wast trying to achieve. Not canonicalizing the NamespaceDecl in
getOrCreateNamespace is suficient.
rdar://problem/29339538
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 9d77c61bd5..bf178dd7fd 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2860,7 +2860,7 @@ void CGDebugInfo::collectFunctionDeclProps(GlobalDecl GD, llvm::DIFile *Unit, if (DebugKind >= codegenoptions::LimitedDebugInfo) { if (const NamespaceDecl *NSDecl = - dyn_cast_or_null<NamespaceDecl>(FD->getLexicalDeclContext())) + dyn_cast_or_null<NamespaceDecl>(FD->getDeclContext())) FDContext = getOrCreateNamespace(NSDecl); else if (const RecordDecl *RDecl = dyn_cast_or_null<RecordDecl>(FD->getDeclContext())) { |