DebugInfo: Avoid unnecessarily looking up the context when the declaration is already...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 18 Feb 2014 20:52:05 +0000 (20:52 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 18 Feb 2014 20:52:05 +0000 (20:52 +0000)
No functional change intended.

llvm-svn: 201602

clang/lib/CodeGen/CGDebugInfo.cpp

index dddc7e7..a72f9e6 100644 (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;
   }