diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-09-14 02:25:19 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-09-14 02:25:19 +0000 |
commit | 5df6ffd9480f0f0165bbc752e16c38cffd206527 (patch) | |
tree | e2994a4d8302071105f1afcf6bac15abc232a5d3 /lib | |
parent | c493fb2f4d67bfe4b695d9067eae178ced5970cc (diff) | |
download | llvm-5df6ffd9480f0f0165bbc752e16c38cffd206527.tar.gz llvm-5df6ffd9480f0f0165bbc752e16c38cffd206527.tar.bz2 llvm-5df6ffd9480f0f0165bbc752e16c38cffd206527.tar.xz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 7b2afde0a0..140e6bd8b1 100644 --- a/lib/VMCore/Verifier.cpp +++ b/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<const Type *, 16> 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<const Type *, 16> Types; + + // Disallow copying. + TypeSet(const TypeSet &); + TypeSet &operator=(const TypeSet &); }; struct Verifier : public FunctionPass, public InstVisitor<Verifier> { |