[cfe-commits] r112246 - /cfe/trunk/lib/AST/ASTContext.cpp

Douglas Gregor dgregor at apple.com
Thu Aug 26 17:11:28 PDT 2010


Author: dgregor
Date: Thu Aug 26 19:11:28 2010
New Revision: 112246

URL: http://llvm.org/viewvc/llvm-project?rev=112246&view=rev
Log:
Don't recurse twice when we can recurse once

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=112246&r1=112245&r2=112246&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Aug 26 19:11:28 2010
@@ -765,9 +765,10 @@
 
   case Type::Typedef: {
     const TypedefDecl *Typedef = cast<TypedefType>(T)->getDecl();
-    Align = std::max(Typedef->getMaxAlignment(),
-                     getTypeAlign(Typedef->getUnderlyingType().getTypePtr()));
-    Width = getTypeSize(Typedef->getUnderlyingType().getTypePtr());
+    std::pair<uint64_t, unsigned> Info
+      = getTypeInfo(Typedef->getUnderlyingType().getTypePtr());
+    Align = std::max(Typedef->getMaxAlignment(), Info.second);
+    Width = Info.first;
     break;
   }
 





More information about the cfe-commits mailing list