[PATCH] add default value for Args parameter of Builder.CreateCall function

David Blaikie dblaikie at gmail.com
Fri Jun 12 14:29:36 PDT 2015


Sounds totally fine to me - perhaps you could find some examples of this in
the codebase and update them at the same time to demonstrate the new
functionality?

On Tue, Jun 9, 2015 at 12:21 PM, <servuswiegehtz at yahoo.de> wrote:

> From: Pete Abred <servuswiegehtz at yahoo.de>
>
> Default parameter allows for easier usage for functions without
> parameters, e.g.:
> Builder.CreateCall(abort);
>
> ---
>  include/llvm/IR/IRBuilder.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/llvm/IR/IRBuilder.h b/include/llvm/IR/IRBuilder.h
> index adf6924..fdf65a3 100644
> --- a/include/llvm/IR/IRBuilder.h
> +++ b/include/llvm/IR/IRBuilder.h
> @@ -1465,7 +1465,7 @@ public:
>      return Insert(PHINode::Create(Ty, NumReservedValues), Name);
>    }
>
> -  CallInst *CreateCall(Value *Callee, ArrayRef<Value *> Args,
> +  CallInst *CreateCall(Value *Callee, ArrayRef<Value *> Args = {},
>                         const Twine &Name = "") {
>      return Insert(CallInst::Create(Callee, Args), Name);
>    }
> --
> 2.4.2
>
> _______________________________________________
> 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/20150612/96981fa2/attachment.html>


More information about the llvm-commits mailing list