Add a spiffy little "CreateCall2" method, which can be used to make
authorChris Lattner <sabre@nondot.org>
Thu, 1 May 2008 05:11:00 +0000 (05:11 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 1 May 2008 05:11:00 +0000 (05:11 +0000)
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

include/llvm/Support/IRBuilder.h

index 4dfc14b89a7ae999bbcc234f31209039c52faa80..1bc61aa99fad6167a11a5f7c13e4b12c13cb8671 100644 (file)
@@ -475,15 +475,20 @@ public:
   CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") {
     return Insert(CallInst::Create(Callee, Arg, Name));
   }
-
+  CallInst *CreateCall2(Value *Callee, Value *Arg1, Value *Arg2,
+                        const char *Name = "") {
+    Value *Args[] = { Arg1, Arg2 };
+    return Insert(CallInst::Create(Callee, Args, Args+2, Name));
+  }
+  
   template<typename InputIterator>
   CallInst *CreateCall(Value *Callee, InputIterator ArgBegin, 
-                     InputIterator ArgEnd, const char *Name = "") {
+                       InputIterator ArgEnd, const char *Name = "") {
     return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd, Name));
   }
 
   Value *CreateSelect(Value *C, Value *True, Value *False,
-                         const char *Name = "") {
+                      const char *Name = "") {
     if (Constant *CC = dyn_cast<Constant>(C))
       if (Constant *TC = dyn_cast<Constant>(True))
         if (Constant *FC = dyn_cast<Constant>(False))