aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-27 00:11:28 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-27 00:11:28 +0000
commitdf1367af26cb2959775e9511108f12dcd2370a27 (patch)
tree2551abd23602a0820bbbfa944e72ffeb84ca0166 /lib/AST/ASTContext.cpp
parentf312b1ea179f1c44371f9ee0cd0bc006f612de11 (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.cpp7
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;
}