]> granicus.if.org Git - clang/commitdiff
Don't recurse twice when we can recurse once
authorDouglas Gregor <dgregor@apple.com>
Fri, 27 Aug 2010 00:11:28 +0000 (00:11 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 27 Aug 2010 00:11:28 +0000 (00:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112246 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 37ef59cc36fc87d8b0fd8573372f0a2c29599aea..749c9db6d6baeee5b1012da10032cc785fd4c2ca 100644 (file)
@@ -765,9 +765,10 @@ ASTContext::getTypeInfo(const Type *T) {
 
   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;
   }