]> granicus.if.org Git - clang/commitdiff
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201602 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index dddc7e7569fd02798242416980f2143a52729dcf..a72f9e6bf7776a5bada278ff16d89f0e4a63c616 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;
   }