r227953 - AST: Hoist RT->getDecl() into a variable

David Majnemer david.majnemer at gmail.com
Tue Feb 3 00:49:29 PST 2015


Author: majnemer
Date: Tue Feb  3 02:49:29 2015
New Revision: 227953

URL: http://llvm.org/viewvc/llvm-project?rev=227953&view=rev
Log:
AST: Hoist RT->getDecl() into a variable

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=227953&r1=227952&r2=227953&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Feb  3 02:49:29 2015
@@ -1682,10 +1682,11 @@ TypeInfo ASTContext::getTypeInfoImpl(con
     }
 
     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;
   }
 





More information about the cfe-commits mailing list