[llvm-commits] [llvm] r81749 - /llvm/trunk/lib/VMCore/Verifier.cpp

Nick Lewycky nicholas at mxc.ca
Sun Sep 13 19:25:19 PDT 2009


Author: nicholas
Date: Sun Sep 13 21:25:19 2009
New Revision: 81749

URL: http://llvm.org/viewvc/llvm-project?rev=81749&view=rev
Log:
Fifth time's a charm! Remove ourselves as abstract type listeners once we've
been told that the type is no longer abstract.

Modified:
    llvm/trunk/lib/VMCore/Verifier.cpp

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=81749&r1=81748&r2=81749&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Sun Sep 13 21:25:19 2009
@@ -107,8 +107,9 @@
 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 @@
       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> {





More information about the llvm-commits mailing list