aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/GetElementPtrTypeIterator.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/GetElementPtrTypeIterator.h b/include/llvm/Support/GetElementPtrTypeIterator.h
index d9b38f2740..8f6c224a26 100644
--- a/include/llvm/Support/GetElementPtrTypeIterator.h
+++ b/include/llvm/Support/GetElementPtrTypeIterator.h
@@ -53,6 +53,11 @@ namespace llvm {
return CurTy;
}
+ const Type *getIndexedType() const {
+ const CompositeType *CT = cast<CompositeType>(CurTy);
+ return CT->getTypeAtIndex(getOperand());
+ }
+
// This is a non-standard operator->. It allows you to call methods on the
// current type directly.
const Type *operator->() const { return operator*(); }