From: Douglas Gregor Date: Fri, 27 Aug 2010 00:11:28 +0000 (+0000) Subject: Don't recurse twice when we can recurse once X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df1367af26cb2959775e9511108f12dcd2370a27;p=clang Don't recurse twice when we can recurse once git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112246 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 37ef59cc36..749c9db6d6 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -765,9 +765,10 @@ ASTContext::getTypeInfo(const Type *T) { case Type::Typedef: { const TypedefDecl *Typedef = cast(T)->getDecl(); - Align = std::max(Typedef->getMaxAlignment(), - getTypeAlign(Typedef->getUnderlyingType().getTypePtr())); - Width = getTypeSize(Typedef->getUnderlyingType().getTypePtr()); + std::pair Info + = getTypeInfo(Typedef->getUnderlyingType().getTypePtr()); + Align = std::max(Typedef->getMaxAlignment(), Info.second); + Width = Info.first; break; }