summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-02-18 20:52:05 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-02-18 20:52:05 +0000
commit65ec94e3481a2dcb57ff29f6046bb3c4505949af (patch)
tree3261eb41bc44e1963a4422d99b9318eb1c8c53f8
parent7c27a265dc84069451cba872d89f4234dcee2a0f (diff)
downloadbcm5719-llvm-65ec94e3481a2dcb57ff29f6046bb3c4505949af.tar.gz
bcm5719-llvm-65ec94e3481a2dcb57ff29f6046bb3c4505949af.zip
DebugInfo: Avoid unnecessarily looking up the context when the declaration is already built.
No functional change intended. llvm-svn: 201602
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index dddc7e7569f..a72f9e6bf77 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1476,10 +1476,9 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) {
// If the class is dynamic, only emit a declaration. A definition will be
// emitted whenever the vtable is emitted.
(CXXDecl && CXXDecl->hasDefinition() && CXXDecl->isDynamicClass())))) {
- llvm::DIDescriptor FDContext =
- getContextDescriptor(cast<Decl>(RD->getDeclContext()));
if (!T)
- T = getOrCreateRecordFwdDecl(Ty, FDContext);
+ T = getOrCreateRecordFwdDecl(
+ Ty, getContextDescriptor(cast<Decl>(RD->getDeclContext())));
return T;
}
OpenPOWER on IntegriCloud