[llvm-commits] [llvm] r50514 - /llvm/trunk/include/llvm/Support/IRBuilder.h

Chris Lattner sabre at nondot.org
Wed Apr 30 22:11:00 PDT 2008


Author: lattner
Date: Thu May  1 00:11:00 2008
New Revision: 50514

URL: http://llvm.org/viewvc/llvm-project?rev=50514&view=rev
Log:
Add a spiffy little "CreateCall2" method, which can be used to make
a function call that takes two Value*'s as arguments.

Modified:
    llvm/trunk/include/llvm/Support/IRBuilder.h

Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=50514&r1=50513&r2=50514&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/IRBuilder.h Thu May  1 00:11:00 2008
@@ -475,15 +475,20 @@
   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))





More information about the llvm-commits mailing list