From 22c4a497ab3547ff018886dbc59f39b78e40340a Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 14 Sep 2009 02:25:19 +0000 Subject: [PATCH] Fifth time's a charm! Remove ourselves as abstract type listeners once we've been told that the type is no longer abstract. llvm-svn: 81749 --- llvm/lib/VMCore/Verifier.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 7b2afde0a0e8..140e6bd8b15a 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -107,8 +107,9 @@ PreVer("preverify", "Preliminary module verification"); static const PassInfo *const PreVerifyID = &PreVer; namespace { - struct TypeSet : public AbstractTypeUser { - SmallSetVector Types; + class TypeSet : public AbstractTypeUser { + public: + TypeSet() {} /// Insert a type into the set of types. bool insert(const Type *Ty) { @@ -138,8 +139,20 @@ namespace { Types.remove(OldTy); 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 {} + + private: + SmallSetVector Types; + + // Disallow copying. + TypeSet(const TypeSet &); + TypeSet &operator=(const TypeSet &); }; struct Verifier : public FunctionPass, public InstVisitor {