From df1367af26cb2959775e9511108f12dcd2370a27 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 27 Aug 2010 00:11:28 +0000 Subject: [PATCH] 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 --- lib/AST/ASTContext.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } -- 2.50.1