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

David Blaikie dblaikie at gmail.com
Tue Feb 18 12:52:05 PST 2014


Author: dblaikie
Date: Tue Feb 18 14:52:05 2014
New Revision: 201602

URL: http://llvm.org/viewvc/llvm-project?rev=201602&view=rev
Log:
DebugInfo: Avoid unnecessarily looking up the context when the declaration is already built.

No functional change intended.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=201602&r1=201601&r2=201602&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Feb 18 14:52:05 2014
@@ -1476,10 +1476,9 @@ llvm::DIType CGDebugInfo::CreateType(con
         // 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;
   }
 





More information about the cfe-commits mailing list