summaryrefslogtreecommitdiff
path: root/include/llvm/Support/NoFolder.h
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-21 07:52:17 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-21 07:52:17 +0000
commit12fc16f1950796486988dc91ba69797efa5bdb64 (patch)
tree56bcac728655a7730190747977d3e77c57e1eff1 /include/llvm/Support/NoFolder.h
parentc30a38f34bdfecb99ce49e3ffa479039c9bf0209 (diff)
downloadllvm-12fc16f1950796486988dc91ba69797efa5bdb64.tar.gz
llvm-12fc16f1950796486988dc91ba69797efa5bdb64.tar.bz2
llvm-12fc16f1950796486988dc91ba69797efa5bdb64.tar.xz
Convert ConstantFolder APIs to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/NoFolder.h')
-rw-r--r--include/llvm/Support/NoFolder.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h
index 28447f7497..7f14cd2bcd 100644
--- a/include/llvm/Support/NoFolder.h
+++ b/include/llvm/Support/NoFolder.h
@@ -177,22 +177,23 @@ public:
// Memory Instructions
//===--------------------------------------------------------------------===//
- Constant *CreateGetElementPtr(Constant *C, Constant* const *IdxList,
- unsigned NumIdx) const {
- return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx);
+ Constant *CreateGetElementPtr(Constant *C,
+ ArrayRef<Constant *> IdxList) const {
+ return ConstantExpr::getGetElementPtr(C, IdxList.data(), IdxList.size());
}
- Instruction *CreateGetElementPtr(Constant *C, Value* const *IdxList,
- unsigned NumIdx) const {
- return GetElementPtrInst::Create(C, IdxList, IdxList+NumIdx);
+ Instruction *CreateGetElementPtr(Constant *C,
+ ArrayRef<Value *> IdxList) const {
+ return GetElementPtrInst::Create(C, IdxList.begin(), IdxList.end());
}
- Constant *CreateInBoundsGetElementPtr(Constant *C, Constant* const *IdxList,
- unsigned NumIdx) const {
- return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx);
- }
- Instruction *CreateInBoundsGetElementPtr(Constant *C, Value* const *IdxList,
- unsigned NumIdx) const {
- return GetElementPtrInst::CreateInBounds(C, IdxList, IdxList+NumIdx);
+ Constant *CreateInBoundsGetElementPtr(Constant *C,
+ ArrayRef<Constant *> IdxList) const {
+ return ConstantExpr::getInBoundsGetElementPtr(C, IdxList.data(),
+ IdxList.size());
+ }
+ Instruction *CreateInBoundsGetElementPtr(Constant *C,
+ ArrayRef<Value *> IdxList) const {
+ return GetElementPtrInst::CreateInBounds(C, IdxList.begin(), IdxList.end());
}
//===--------------------------------------------------------------------===//