[llvm-commits] CVS: llvm/include/llvm/Type.h

Chris Lattner lattner at cs.uiuc.edu
Mon Oct 13 10:35:01 PDT 2003


Changes in directory llvm/include/llvm:

Type.h updated: 1.33 -> 1.34

---
Log message:

Add operator= for type iterators to make them assignable


---
Diffs of the changes:  (+6 -0)

Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.33 llvm/include/llvm/Type.h:1.34
--- llvm/include/llvm/Type.h:1.33	Mon Oct 13 10:30:59 2003
+++ llvm/include/llvm/Type.h	Mon Oct 13 10:34:17 2003
@@ -250,6 +250,12 @@
   public:
     TypeIterator(const Type *ty, unsigned idx) : Ty(ty), Idx(idx) {}
     ~TypeIterator() {}
+
+    const _Self &operator=(const _Self &RHS) {
+      assert(Ty == RHS.Ty && "Cannot assign from different types!");
+      Idx = RHS.Idx;
+      return *this;
+    }
     
     bool operator==(const _Self& x) const { return Idx == x.Idx; }
     bool operator!=(const _Self& x) const { return !operator==(x); }





More information about the llvm-commits mailing list