Don't recurse twice when we can recurse once

llvm-svn: 112246
This commit is contained in:
Douglas Gregor 2010-08-27 00:11:28 +00:00
parent 2561aa6124
commit f5bae22db7

View File

@ -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;
}