DebugInfo: Avoid unnecessarily looking up the context when the declaration is already built.

No functional change intended.

llvm-svn: 201602
This commit is contained in:
David Blaikie
2014-02-18 20:52:05 +00:00
parent 7c27a265dc
commit 65ec94e348

View File

@@ -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;
}