summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJin-Gu Kang <jaykang10@imrc.kist.re.kr>2012-08-17 08:54:57 +0000
committerJin-Gu Kang <jaykang10@imrc.kist.re.kr>2012-08-17 08:54:57 +0000
commit734fd27647bbfcf66d26e32fced5e4021dfb67e4 (patch)
tree105d46bce88883c4b9708000f5fbcdc4e7a8a5f3 /include
parent63a99ff53ad859534b0c8161c2819692b5372b52 (diff)
downloadllvm-734fd27647bbfcf66d26e32fced5e4021dfb67e4.tar.gz
llvm-734fd27647bbfcf66d26e32fced5e4021dfb67e4.tar.bz2
llvm-734fd27647bbfcf66d26e32fced5e4021dfb67e4.tar.xz
Insertion of NoFolder functions to avoid ambiguous overload warnings or errors about whether to convert Idx to ArrayRef<Constant *> or ArrayRef<Value *> like ConstantFolder and TargetFolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/NoFolder.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h
index 75c1a79265..8e41a64b17 100644
--- a/include/llvm/Support/NoFolder.h
+++ b/include/llvm/Support/NoFolder.h
@@ -181,6 +181,12 @@ public:
ArrayRef<Constant *> IdxList) const {
return ConstantExpr::getGetElementPtr(C, IdxList);
}
+ Constant *CreateGetElementPtr(Constant *C, Constant *Idx) const {
+ // This form of the function only exists to avoid ambiguous overload
+ // warnings about whether to convert Idx to ArrayRef<Constant *> or
+ // ArrayRef<Value *>.
+ return ConstantExpr::getGetElementPtr(C, Idx);
+ }
Instruction *CreateGetElementPtr(Constant *C,
ArrayRef<Value *> IdxList) const {
return GetElementPtrInst::Create(C, IdxList);
@@ -190,6 +196,12 @@ public:
ArrayRef<Constant *> IdxList) const {
return ConstantExpr::getInBoundsGetElementPtr(C, IdxList);
}
+ Constant *CreateInBoundsGetElementPtr(Constant *C, Constant *Idx) const {
+ // This form of the function only exists to avoid ambiguous overload
+ // warnings about whether to convert Idx to ArrayRef<Constant *> or
+ // ArrayRef<Value *>.
+ return ConstantExpr::getInBoundsGetElementPtr(C, Idx);
+ }
Instruction *CreateInBoundsGetElementPtr(Constant *C,
ArrayRef<Value *> IdxList) const {
return GetElementPtrInst::CreateInBounds(C, IdxList);