[llvm-commits] [llvm] r162090 - /llvm/trunk/include/llvm/Support/NoFolder.h
Chandler Carruth
chandlerc at google.com
Fri Aug 17 02:01:44 PDT 2012
On Fri, Aug 17, 2012 at 1:54 AM, Jin-Gu Kang <jaykang10 at imrc.kist.re.kr>wrote:
> Author: jaykang10
> Date: Fri Aug 17 03:54:57 2012
> New Revision: 162090
>
> URL: http://llvm.org/viewvc/llvm-project?rev=162090&view=rev
> Log:
> 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.
>
> Modified:
> llvm/trunk/include/llvm/Support/NoFolder.h
>
> Modified: llvm/trunk/include/llvm/Support/NoFolder.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/NoFolder.h?rev=162090&r1=162089&r2=162090&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/NoFolder.h (original)
> +++ llvm/trunk/include/llvm/Support/NoFolder.h Fri Aug 17 03:54:57 2012
> @@ -181,6 +181,12 @@
> 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 *>.
>
This comment doesn't seem right at all -- this function doesn't accept
anything to do with ArrayRef. The comment seems copy/pasted from the edit
below where it is correct, but it needs updating for this signature.
> + return ConstantExpr::getGetElementPtr(C, Idx);
> + }
> Instruction *CreateGetElementPtr(Constant *C,
> ArrayRef<Value *> IdxList) const {
> return GetElementPtrInst::Create(C, IdxList);
> @@ -190,6 +196,12 @@
> 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);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120817/ed1a8c52/attachment.html>
More information about the llvm-commits
mailing list