summaryrefslogtreecommitdiff
path: root/include/llvm/Support/TargetFolder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/TargetFolder.h')
-rw-r--r--include/llvm/Support/TargetFolder.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h
index 2be8b74eb6..e6b501c88e 100644
--- a/include/llvm/Support/TargetFolder.h
+++ b/include/llvm/Support/TargetFolder.h
@@ -152,6 +152,12 @@ public:
return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList.data(),
IdxList.size()));
}
+ 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 Fold(ConstantExpr::getInBoundsGetElementPtr(C, &Idx, 1));
+ }
Constant *CreateInBoundsGetElementPtr(Constant *C,
ArrayRef<Value *> IdxList) const {
return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList.data(),