Thanks to David Balkie for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214286
91177308-0d34-0410-b5e6-
96231b3b80d8
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