llvm.org GIT mirror llvm / 4b9f046
Add a spiffy little "CreateCall2" method, which can be used to make a function call that takes two Value*'s as arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50514 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
474474 CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") {
475475 return Insert(CallInst::Create(Callee, Arg, Name));
476476 }
477
477 CallInst *CreateCall2(Value *Callee, Value *Arg1, Value *Arg2,
478 const char *Name = "") {
479 Value *Args[] = { Arg1, Arg2 };
480 return Insert(CallInst::Create(Callee, Args, Args+2, Name));
481 }
482
478483 template
479484 CallInst *CreateCall(Value *Callee, InputIterator ArgBegin,
480 InputIterator ArgEnd, const char *Name = "") {
485 InputIterator ArgEnd, const char *Name = "") {
481486 return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd, Name));
482487 }
483488
484489 Value *CreateSelect(Value *C, Value *True, Value *False,
485 const char *Name = "") {
490 const char *Name = "") {
486491 if (Constant *CC = dyn_cast(C))
487492 if (Constant *TC = dyn_cast(True))
488493 if (Constant *FC = dyn_cast(False))