- /// finishRefinement - This method is called after we have updated an existing
- /// type with its new components. We must now either merge the type away with
+ /// TypeBecameConcrete - When Ty gets a notification that TheType just became
+ /// concrete, drop uses and make Ty non-abstract if we should.
+ void TypeBecameConcrete(TypeClass *Ty, const DerivedType *TheType) {
+ // If the element just became concrete, remove 'ty' from the abstract
+ // type user list for the type. Do this for as many times as Ty uses
+ // OldType.
+ for (unsigned i = 0, e = Ty->ContainedTys.size(); i != e; ++i)
+ if (Ty->ContainedTys[i] == TheType)
+ TheType->removeAbstractTypeUser(Ty);
+
+ // If the type is currently thought to be abstract, rescan all of our
+ // subtypes to see if the type has just become concrete! Note that this
+ // may send out notifications to AbstractTypeUsers that types become
+ // concrete.
+ if (Ty->isAbstract())
+ Ty->PromoteAbstractToConcrete();
+ }
+
+ /// RefineAbstractType - This method is called after we have merged a type
+ /// with another one. We must now either merge the type away with