diff options
author | Eric Christopher <echristo@gmail.com> | 2014-03-26 23:09:30 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-03-26 23:09:30 +0000 |
commit | 43daad555ded911091d757fbc401b017317e6cf4 (patch) | |
tree | d9e34e7ab724d0756343261df59fe6f5da046ae5 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | df3e34d9444ee5fa8c1870fd17f65970f2327784 (diff) | |
download | bcm5719-llvm-43daad555ded911091d757fbc401b017317e6cf4.tar.gz bcm5719-llvm-43daad555ded911091d757fbc401b017317e6cf4.zip |
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.
llvm-svn: 204874
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 1a3089a14b2..92f5e63296e 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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)) { |