forked from OSchip/llvm-project
when an enum type is completed, only flush the type cache when
the enum has already been converted. If not, there cannot be any types built on top of it, so there is no need to flush the cache. llvm-svn: 134841
This commit is contained in:
parent
f5926b460b
commit
955d9c715e
|
@ -114,7 +114,9 @@ void CodeGenTypes::UpdateCompletedType(const TagDecl *TD) {
|
|||
// If this is an enum being completed, then we flush all non-struct types from
|
||||
// the cache. This allows function types and other things that may be derived
|
||||
// from the enum to be recomputed.
|
||||
if (isa<EnumDecl>(TD)) {
|
||||
if (const EnumDecl *ED = dyn_cast<EnumDecl>(TD)) {
|
||||
// Only flush the cache if we've actually already converted this type.
|
||||
if (TypeCache.count(ED->getTypeForDecl()))
|
||||
TypeCache.clear();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue