mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-01 01:14:12 +00:00
Work with gepi's and constant exprs. Also, add versions of iterator ctors that take references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9d7c9ea053
commit
c4c6b9e5bc
@ -24,21 +24,21 @@ namespace llvm {
|
||||
: public forward_iterator<const Type *, ptrdiff_t> {
|
||||
typedef forward_iterator<const Type*, ptrdiff_t> super;
|
||||
|
||||
GetElementPtrInst *TheGEP;
|
||||
User *TheGEP; // Either GetElemenPtrInst or ConstantExpr
|
||||
const Type *CurTy;
|
||||
unsigned Operand;
|
||||
|
||||
gep_type_iterator() {}
|
||||
public:
|
||||
|
||||
static gep_type_iterator begin(GetElementPtrInst *gep) {
|
||||
static gep_type_iterator begin(User *gep) {
|
||||
gep_type_iterator I;
|
||||
I.TheGEP = gep;
|
||||
I.CurTy = gep->getOperand(0)->getType();
|
||||
I.Operand = 1;
|
||||
return I;
|
||||
}
|
||||
static gep_type_iterator end(GetElementPtrInst *gep) {
|
||||
static gep_type_iterator end(User *gep) {
|
||||
gep_type_iterator I;
|
||||
I.TheGEP = gep;
|
||||
I.CurTy = 0;
|
||||
@ -80,13 +80,20 @@ namespace llvm {
|
||||
}
|
||||
};
|
||||
|
||||
inline gep_type_iterator gep_type_begin(GetElementPtrInst *GEP) {
|
||||
inline gep_type_iterator gep_type_begin(User *GEP) {
|
||||
return gep_type_iterator::begin(GEP);
|
||||
}
|
||||
|
||||
inline gep_type_iterator gep_type_end(GetElementPtrInst *GEP) {
|
||||
inline gep_type_iterator gep_type_end(User *GEP) {
|
||||
return gep_type_iterator::end(GEP);
|
||||
}
|
||||
inline gep_type_iterator gep_type_begin(User &GEP) {
|
||||
return gep_type_iterator::begin(&GEP);
|
||||
}
|
||||
|
||||
inline gep_type_iterator gep_type_end(User &GEP) {
|
||||
return gep_type_iterator::end(&GEP);
|
||||
}
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user