Fifth time's a charm! Remove ourselves as abstract type listeners once we've

been told that the type is no longer abstract.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81749 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2009-09-14 02:25:19 +00:00
parent c493fb2f4d
commit 5df6ffd948

View File

@ -107,8 +107,9 @@ PreVer("preverify", "Preliminary module verification");
static const PassInfo *const PreVerifyID = &PreVer; static const PassInfo *const PreVerifyID = &PreVer;
namespace { namespace {
struct TypeSet : public AbstractTypeUser { class TypeSet : public AbstractTypeUser {
SmallSetVector<const Type *, 16> Types; public:
TypeSet() {}
/// Insert a type into the set of types. /// Insert a type into the set of types.
bool insert(const Type *Ty) { bool insert(const Type *Ty) {
@ -138,8 +139,20 @@ namespace {
Types.remove(OldTy); Types.remove(OldTy);
OldTy->removeAbstractTypeUser(this); OldTy->removeAbstractTypeUser(this);
} }
void typeBecameConcrete(const DerivedType *AbsTy) {}
/// Stop listening for changes to a type which is no longer abstract.
void typeBecameConcrete(const DerivedType *AbsTy) {
AbsTy->removeAbstractTypeUser(this);
}
void dump() const {} void dump() const {}
private:
SmallSetVector<const Type *, 16> Types;
// Disallow copying.
TypeSet(const TypeSet &);
TypeSet &operator=(const TypeSet &);
}; };
struct Verifier : public FunctionPass, public InstVisitor<Verifier> { struct Verifier : public FunctionPass, public InstVisitor<Verifier> {