<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Shuying,<div><br></div><div>You will find in the documentation that amongst the overloaded CallInst::Create()'s there is one that takes no function arguments:</div><div><span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14px; "></span></div><div>static CallInst* llvm::CallInst::Create ( Value * F, const Twine & NameStr, BasicBlock * InsertAtEnd);<br><br></div><div>Regards</div><div><br><div><div>On 23/11/2010, at 11:20 AM, Shuying Liang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi, I want to insert a function with a void type parameter,<br>for example: int foo(void);<br>OI declared<br>fcall2 = M.getOrInsertFunction("foo",<br><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>    IntegerType::get(M.getContext(), 32),<br><span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>    Type::getVoidTy(M.getContext()));<br><br>then the question is how to get the void type value to make the<br>CallInst inserted sucessfully? (what should be ********)<br>CallInst::Create(fcall2, ******, "", insertPos);<br><br><br>-- <br><br>--Shuying<br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></body></html>