title: Creating a call instruction using the IRBuilder to have variable number of arguments - llvm 2.8
body: <p>I am trying to create a Call Instruction using the llvm IRBuilder as below</p>
  
  <pre><code>llvm::Value* FunctionCall::genLLVM(GenLLVM* g){
      std::vector&lt;llvm::Value*&gt; paramArrayRef;
      std::list&lt;Value*&gt; paramList = getParamList();
      std::list&lt;Value*&gt;::iterator paramIter = paramList.begin();
      unsigned int i = 0;
      for(; paramIter != paramList.end(); ++paramIter, ++i)
          paramArrayRef.push_back((*paramIter)-&gt;genLLVM(g));
  
      llvm::FunctionType *FT = &amp;getFunctionType(getFunction());
      llvm::Function *F = static_cast&lt;llvm::Function*&gt;(g-&gt;getModule().getOrInsertFunction(getFunction().getName(), FT));
  
      return g-&gt;getBuilder().CreateCall(F, paramArrayRef,"");
  }
  
  ./genllvm.cpp:67: error: no matching function for call to ‘llvm::IRBuilder&lt;true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter&lt;true&gt; &gt;::CreateCall(llvm::Function*&amp;, std::vector&lt;llvm::Value*, std::allocator&lt;llvm::Value*&gt; &gt;&amp;, const char [1])’
  /usr/include/llvm/Support/IRBuilder.h:891: note: candidates are: llvm::CallInst* llvm::IRBuilder&lt;preserveNames, T, Inserter&gt;::CreateCall(llvm::Value*, const llvm::Twine&amp;) [with bool preserveNames = true, T = llvm::ConstantFolder, Inserter = llvm::IRBuilderDefaultInserter&lt;true&gt;]
  /usr/include/llvm/Support/IRBuilder.h:894: note:                 llvm::CallInst* llvm::IRBuilder&lt;preserveNames, T, Inserter&gt;::CreateCall(llvm::Value*, llvm::Value*, const llvm::Twine&amp;) [with bool preserveNames = true, T = llvm::ConstantFolder, Inserter = llvm::IRBuilderDefaultInserter&lt;true&gt;]
  </code></pre>
  
  <p>I went throught the IRBuilder.h file but couldn't find any function that can take variable arguments. Is there a function that creates a function call with variable number of arguments. Btw, I am using llvm 2.8</p>