diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-27 00:11:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-27 00:11:28 +0000 |
commit | df1367af26cb2959775e9511108f12dcd2370a27 (patch) | |
tree | 2551abd23602a0820bbbfa944e72ffeb84ca0166 /lib/AST/ASTContext.cpp | |
parent | f312b1ea179f1c44371f9ee0cd0bc006f612de11 (diff) |
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
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 7 |
1 files 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<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; } |