X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FNoFolder.h;h=8e41a64b1770305b4afb07fb90a82716d7033579;hb=55907d1274ce715b92d584e305e0708e333a33c0;hp=7f14cd2bcd19f25f90921a01cb31b8c28dcbeb64;hpb=12fc16f1950796486988dc91ba69797efa5bdb64;p=oota-llvm.git diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h index 7f14cd2bcd1..8e41a64b177 100644 --- a/include/llvm/Support/NoFolder.h +++ b/include/llvm/Support/NoFolder.h @@ -179,21 +179,32 @@ public: Constant *CreateGetElementPtr(Constant *C, ArrayRef IdxList) const { - return ConstantExpr::getGetElementPtr(C, IdxList.data(), IdxList.size()); + 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 or + // ArrayRef. + return ConstantExpr::getGetElementPtr(C, Idx); } Instruction *CreateGetElementPtr(Constant *C, ArrayRef IdxList) const { - return GetElementPtrInst::Create(C, IdxList.begin(), IdxList.end()); + return GetElementPtrInst::Create(C, IdxList); } Constant *CreateInBoundsGetElementPtr(Constant *C, ArrayRef IdxList) const { - return ConstantExpr::getInBoundsGetElementPtr(C, IdxList.data(), - IdxList.size()); + 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 or + // ArrayRef. + return ConstantExpr::getInBoundsGetElementPtr(C, Idx); } Instruction *CreateInBoundsGetElementPtr(Constant *C, ArrayRef IdxList) const { - return GetElementPtrInst::CreateInBounds(C, IdxList.begin(), IdxList.end()); + return GetElementPtrInst::CreateInBounds(C, IdxList); } //===--------------------------------------------------------------------===//