From: Chris Lattner Date: Sun, 4 Apr 2004 19:46:54 +0000 (+0000) Subject: Support iteration over constant instructions X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=72e606e2bd76452ac6760ceed258b377cd8862a2;p=oota-llvm.git Support iteration over constant instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12645 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/GetElementPtrTypeIterator.h b/include/llvm/Support/GetElementPtrTypeIterator.h index 068ec45dc5a..d9b38f27400 100644 --- a/include/llvm/Support/GetElementPtrTypeIterator.h +++ b/include/llvm/Support/GetElementPtrTypeIterator.h @@ -19,7 +19,7 @@ #include "llvm/DerivedTypes.h" namespace llvm { - template + template class generic_gep_type_iterator : public forward_iterator { typedef forward_iterator super; @@ -76,18 +76,18 @@ namespace llvm { typedef generic_gep_type_iterator<> gep_type_iterator; - inline gep_type_iterator gep_type_begin(User *GEP) { + inline gep_type_iterator gep_type_begin(const User *GEP) { return gep_type_iterator::begin(GEP->getOperand(0)->getType(), GEP->op_begin()+1); } - inline gep_type_iterator gep_type_end(User *GEP) { + inline gep_type_iterator gep_type_end(const User *GEP) { return gep_type_iterator::end(GEP->op_end()); } - inline gep_type_iterator gep_type_begin(User &GEP) { + inline gep_type_iterator gep_type_begin(const User &GEP) { return gep_type_iterator::begin(GEP.getOperand(0)->getType(), GEP.op_begin()+1); } - inline gep_type_iterator gep_type_end(User &GEP) { + inline gep_type_iterator gep_type_end(const User &GEP) { return gep_type_iterator::end(GEP.op_end()); }