Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/IR/GetElementPtrTypeIterator.h
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | Type *getIndexedType() const { | ||||
CompositeType *CT = cast<CompositeType>(CurTy.getPointer()); | CompositeType *CT = cast<CompositeType>(CurTy.getPointer()); | ||||
return CT->getTypeAtIndex(getOperand()); | return CT->getTypeAtIndex(getOperand()); | ||||
} | } | ||||
// This is a non-standard operator->. It allows you to call methods on the | // This is a non-standard operator->. It allows you to call methods on the | ||||
// current type directly. | // current type directly. | ||||
Type *operator->() const { return operator*(); } | Type *operator->() const { return operator*(); } | ||||
Value *getOperand() const { return *OpIt; } | Value *getOperand() const { return const_cast<Value *>(&**OpIt); } | ||||
generic_gep_type_iterator& operator++() { // Preincrement | generic_gep_type_iterator& operator++() { // Preincrement | ||||
if (CurTy.getInt()) { | if (CurTy.getInt()) { | ||||
CurTy.setInt(false); | CurTy.setInt(false); | ||||
} else if (CompositeType *CT = | } else if (CompositeType *CT = | ||||
dyn_cast<CompositeType>(CurTy.getPointer())) { | dyn_cast<CompositeType>(CurTy.getPointer())) { | ||||
CurTy.setPointer(CT->getTypeAtIndex(getOperand())); | CurTy.setPointer(CT->getTypeAtIndex(getOperand())); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |