diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-25 19:58:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-25 19:58:35 +0000 |
commit | 94a28c6bc816486c5754c5492202359a1f733ec4 (patch) | |
tree | 3fdc61653b7acb2d0eb83fb6606f70976f47335d | |
parent | 19ed305339b13178c0dc05ee68fd9999ea17c469 (diff) | |
download | external_llvm-94a28c6bc816486c5754c5492202359a1f733ec4.zip external_llvm-94a28c6bc816486c5754c5492202359a1f733ec4.tar.gz external_llvm-94a28c6bc816486c5754c5492202359a1f733ec4.tar.bz2 |
Rename class to be consistent with other iterator classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10213 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Support/GetElementPtrTypeIterator.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/llvm/Support/GetElementPtrTypeIterator.h b/include/llvm/Support/GetElementPtrTypeIterator.h index b587a7e..95f02a8 100644 --- a/include/llvm/Support/GetElementPtrTypeIterator.h +++ b/include/llvm/Support/GetElementPtrTypeIterator.h @@ -20,7 +20,7 @@ #include "llvm/DerivedTypes.h" namespace llvm { - class GetElementPtrTypeIterator + class gep_type_iterator : public forward_iterator<const Type *, ptrdiff_t> { typedef forward_iterator<const Type*, ptrdiff_t> super; @@ -28,28 +28,28 @@ namespace llvm { const Type *CurTy; unsigned Operand; - GetElementPtrTypeIterator() {} + gep_type_iterator() {} public: - static GetElementPtrTypeIterator begin(GetElementPtrInst *gep) { - GetElementPtrTypeIterator I; + static gep_type_iterator begin(GetElementPtrInst *gep) { + gep_type_iterator I; I.TheGEP = gep; I.CurTy = gep->getOperand(0)->getType(); I.Operand = 1; return I; } - static GetElementPtrTypeIterator end(GetElementPtrInst *gep) { - GetElementPtrTypeIterator I; + static gep_type_iterator end(GetElementPtrInst *gep) { + gep_type_iterator I; I.TheGEP = gep; I.CurTy = 0; I.Operand = gep->getNumOperands(); return I; } - bool operator==(const GetElementPtrTypeIterator& x) const { + bool operator==(const gep_type_iterator& x) const { return Operand == x.Operand; } - bool operator!=(const GetElementPtrTypeIterator& x) const { + bool operator!=(const gep_type_iterator& x) const { return !operator==(x); } @@ -65,7 +65,7 @@ namespace llvm { Value *getOperand() const { return TheGEP->getOperand(Operand); } - GetElementPtrTypeIterator& operator++() { // Preincrement + gep_type_iterator& operator++() { // Preincrement if (const CompositeType *CT = dyn_cast<CompositeType>(CurTy)) { CurTy = CT->getTypeAtIndex(getOperand()); } else { @@ -75,17 +75,17 @@ namespace llvm { return *this; } - GetElementPtrTypeIterator operator++(int) { // Postincrement - GetElementPtrTypeIterator tmp = *this; ++*this; return tmp; + gep_type_iterator operator++(int) { // Postincrement + gep_type_iterator tmp = *this; ++*this; return tmp; } }; - inline GetElementPtrTypeIterator gep_type_begin(GetElementPtrInst *GEP) { - return GetElementPtrTypeIterator::begin(GEP); + inline gep_type_iterator gep_type_begin(GetElementPtrInst *GEP) { + return gep_type_iterator::begin(GEP); } - inline GetElementPtrTypeIterator gep_type_end(GetElementPtrInst *GEP) { - return GetElementPtrTypeIterator::end(GEP); + inline gep_type_iterator gep_type_end(GetElementPtrInst *GEP) { + return gep_type_iterator::end(GEP); } } // end namespace llvm |