From: David Blaikie Date: Tue, 18 Feb 2014 20:52:05 +0000 (+0000) Subject: DebugInfo: Avoid unnecessarily looking up the context when the declaration is already... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16e54606c0c7a7c6ac60c11371fbeddeaf707dce;p=clang DebugInfo: Avoid unnecessarily looking up the context when the declaration is already built. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201602 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index dddc7e7569..a72f9e6bf7 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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(RD->getDeclContext())); if (!T) - T = getOrCreateRecordFwdDecl(Ty, FDContext); + T = getOrCreateRecordFwdDecl( + Ty, getContextDescriptor(cast(RD->getDeclContext()))); return T; }