<pre>it seems the code snippit below cann't be compiled throuth.<br><br>the compiler complains:<br>error: no matching function for call to ‘llvm::IntegerType::get(int)’<br>/usr/local/include/llvm/DerivedTypes.h:108: <br>
note: candidates are: static const llvm::IntegerType* llvm::IntegerType::get(llvm::LLVMContext&, unsigned int)<br><br> <br>Module* makeLLVMModule() {<br> // Module Construction<br> Module* mod = new Module("test", getGlobalContext());<br>
<br><br>Constant* c = mod->getOrInsertFunction("mul_add",<br> /*ret type*/ IntegerType::get(32),<br> /*args*/ IntegerType::get(32),<br> IntegerType::get(32),<br>
IntegerType::get(32),<br> /*varargs terminated with null*/ NULL);<br> <br> Function* mul_add = cast<Function>(c);<br> mul_add->setCallingConv(CallingConv::C);<br>
-------------------------------------------------------------------<br><br> when I change it into the following state, it works out smoothly. <br> <br>Module* makeLLVMModule() {<br> // Module Construction<br> Module* mod = new Module("test", getGlobalContext());<br>
<br><br>Constant* c = mod->getOrInsertFunction("mul_add",<br> /*ret type*/ IntegerType::get(<span style="color: rgb(255, 0, 0);">getGlobalContext()</span>,32),<br> /*args*/ IntegerType::get(<span style="color: rgb(255, 0, 0);">getGlobalContext()</span>,32),<br>
IntegerType::get(<span style="color: rgb(255, 0, 0);">getGlobalContext()</span>,32),<br> IntegerType::get(<span style="color: rgb(255, 0, 0);">getGlobalContext()</span>,32),<br>
/*varargs terminated with null*/ NULL);<br> <br> Function* mul_add = cast<Function>(c);<br> mul_add->setCallingConv(CallingConv::C);<br><br>should the tutorial be modified?<br></pre>