X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FTargetFolder.h;h=c65faa66219e6d12fc7902ee6e36d80307b680a2;hb=48b6a79b2d367ea2e8cf014d8af9d573889d2f7f;hp=2be8b74eb67bc21c9c66f57ec28cd0d83dde0f64;hpb=12fc16f1950796486988dc91ba69797efa5bdb64;p=oota-llvm.git diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index 2be8b74eb67..c65faa66219 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -132,30 +132,32 @@ public: Constant *CreateGetElementPtr(Constant *C, ArrayRef IdxList) const { - return Fold(ConstantExpr::getGetElementPtr(C, IdxList.data(), - IdxList.size())); + return Fold(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 Fold(ConstantExpr::getGetElementPtr(C, &Idx, 1)); + return Fold(ConstantExpr::getGetElementPtr(C, Idx)); } Constant *CreateGetElementPtr(Constant *C, ArrayRef IdxList) const { - return Fold(ConstantExpr::getGetElementPtr(C, IdxList.data(), - IdxList.size())); + return Fold(ConstantExpr::getGetElementPtr(C, IdxList)); } Constant *CreateInBoundsGetElementPtr(Constant *C, ArrayRef IdxList) const { - return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList.data(), - IdxList.size())); + return Fold(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 Fold(ConstantExpr::getInBoundsGetElementPtr(C, Idx)); } Constant *CreateInBoundsGetElementPtr(Constant *C, ArrayRef IdxList) const { - return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList.data(), - IdxList.size())); + return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList)); } //===--------------------------------------------------------------------===//