summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-03-26 23:09:30 +0000
committerEric Christopher <echristo@gmail.com>2014-03-26 23:09:30 +0000
commit55b2d89ef0e286fa369cd6af5e6c64d8e8d58b87 (patch)
treecb148d79a7f5a993234c0aa0bd0911ea55b6525a /lib/CodeGen/CGDebugInfo.cpp
parent20acbd9eeba394e7e53aafda5e59702be8112d94 (diff)
downloadclang-55b2d89ef0e286fa369cd6af5e6c64d8e8d58b87.tar.gz
clang-55b2d89ef0e286fa369cd6af5e6c64d8e8d58b87.tar.bz2
clang-55b2d89ef0e286fa369cd6af5e6c64d8e8d58b87.tar.xz
Just call getContextDescriptor to get the context for subprograms
instead of rolling an inefficient version of the function. This changes some order of emission of metadata nodes, fix up those testcases and make them more flexible to some changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 1a3089a14b..92f5e63296 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -2541,15 +2541,10 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
DebugKind <= CodeGenOptions::DebugLineTablesOnly))
LinkageName = StringRef();
+ // If we aren't in line table only mode then grab a full context and
+ // template parameters for the function.
if (DebugKind >= CodeGenOptions::LimitedDebugInfo) {
- if (const NamespaceDecl *NSDecl =
- dyn_cast_or_null<NamespaceDecl>(FD->getDeclContext()))
- FDContext = getOrCreateNameSpace(NSDecl);
- else if (const RecordDecl *RDecl =
- dyn_cast_or_null<RecordDecl>(FD->getDeclContext()))
- FDContext = getContextDescriptor(cast<Decl>(RDecl));
-
- // Collect template parameters.
+ FDContext = getContextDescriptor(cast<Decl>(FD->getDeclContext()));
TParamsArray = CollectFunctionTemplateParams(FD, Unit);
}
} else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) {