]> granicus.if.org Git - clang/commitdiff
Reduce a variable's scope (no functionality change)
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 1 Aug 2013 18:23:24 +0000 (18:23 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 1 Aug 2013 18:23:24 +0000 (18:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187594 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 4e77f87cc6564aa7c893fca3de3649554b288a81..8267d4449a05596d5b4ff6940ec6a858ff7843bc 100644 (file)
@@ -2207,7 +2207,6 @@ llvm::DIType CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
 
   uint64_t Size = CGM.getContext().getTypeSize(Ty);
   uint64_t Align = CGM.getContext().getTypeAlign(Ty);
-  const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD);
   llvm::DICompositeType RealDecl;
 
   if (RD->isUnion())
@@ -2228,7 +2227,7 @@ llvm::DIType CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
   RegionMap[Ty->getDecl()] = llvm::WeakVH(RealDecl);
   TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = RealDecl;
 
-  if (CXXDecl) {
+  if (const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) {
     // A class's primary base or the class itself contains the vtable.
     llvm::DICompositeType ContainingType;
     const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(RD);