AST: Hoist RT->getDecl() into a variable
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 3 Feb 2015 08:49:29 +0000 (08:49 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 3 Feb 2015 08:49:29 +0000 (08:49 +0000)
llvm-svn: 227953

clang/lib/AST/ASTContext.cpp

index 57f82ed..d480277 100644 (file)
@@ -1682,10 +1682,11 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
     }
 
     const RecordType *RT = cast<RecordType>(TT);
-    const ASTRecordLayout &Layout = getASTRecordLayout(RT->getDecl());
+    const RecordDecl *RD = RT->getDecl();
+    const ASTRecordLayout &Layout = getASTRecordLayout(RD);
     Width = toBits(Layout.getSize());
     Align = toBits(Layout.getAlignment());
-    AlignIsRequired = RT->getDecl()->hasAttr<AlignedAttr>();
+    AlignIsRequired = RD->hasAttr<AlignedAttr>();
     break;
   }