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 | f5bae22db7e2f27d8601d9406696f5dabb2ab7a4 (patch) | |
| tree | 05182ac417292862137ecefd9e032daf70376ca6 /clang/lib/AST/ASTContext.cpp | |
| parent | 2561aa612434bd74efef14e4688a06c065690d94 (diff) | |
| download | bcm5719-llvm-f5bae22db7e2f27d8601d9406696f5dabb2ab7a4.tar.gz bcm5719-llvm-f5bae22db7e2f27d8601d9406696f5dabb2ab7a4.zip | |
Don't recurse twice when we can recurse once
llvm-svn: 112246
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 37ef59cc36f..749c9db6d6b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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; } |

