From: Rafael Espindola Date: Wed, 30 Jul 2014 04:40:23 +0000 (+0000) Subject: Simplify the code. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04a6e2f0309b566651d73877c2e921f993549358;p=clang Simplify the code. Thanks to David Balkie for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214286 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ea18d562b4..a9d606c60d 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1433,13 +1433,12 @@ bool ASTContext::isAlignmentRequired(QualType T) const { TypeInfo ASTContext::getTypeInfo(const Type *T) const { TypeInfo TI = MemoizedTypeInfo[T]; - if (TI.Align) - return TI; - - // This call can invalidate TI, so we need a second lookup. - TypeInfo Temp = getTypeInfoImpl(T); - MemoizedTypeInfo[T] = Temp; - return Temp; + if (!TI.Align) { + // This call can invalidate MemoizedTypeInfo[T], so we need a second lookup. + TI = getTypeInfoImpl(T); + MemoizedTypeInfo[T] = TI; + } + return TI; } /// getTypeInfoImpl - Return the size of the specified type, in bits. This