<div dir="ltr"><div>Hi all, </div><div><br></div><div>Please i need help, I have a method that takes 2 arguments with type char *:</div><div>void branchPredict(char *b1, char *b2){</div><div>---</div><div>--</div><div>}</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">i'm supposed to add this method, in an IR basic bloc:</div><div>to add it into a basic bloc i do:</div><div><br></div><div>//i: is the basic bloc</div>
<div><div>std::vector<Value*> void_43_params;</div><div>Constant* <meta http-equiv="content-type" content="text/html; charset=utf-8">tbname = ConstantArray::get(M.getContext(),i->getNameStr() , true);</div><div>Constant* <meta http-equiv="content-type" content="text/html; charset=utf-8">pbname = ConstantArray::get(M.getContext(),  i->getPrevNode()->getNameStr(), true);</div>
<div>void_43_params.push_back(tbname); </div><div>void_43_params.push_back(pbname);</div><div>CallInst* void_43 = CallInst::Create(func_branchPredict, void_43_params.begin(), void_43_params.end(), "", i->getTerminator());</div>
</div><div><br></div><div>when i execute the pass (opt -load ....)  i get an error:                               </div><div><br></div><div><div>Call parameter type does not match function signature!</div><div>[3 x i8] c"bb\00"</div>
<div> i8*  call void @branchPredict([3 x i8] c"bb\00", [4 x i8] c"bb1\00")</div><div>Call parameter type does not match function signature!</div><div>[4 x i8] c"bb5\00"</div><div> i8*  call void @branchPredict([4 x i8] c"bb5\00", [18 x i8] c"bb3.bb3_crit_edge\00")</div>
<div>Broken module found, compilation aborted!</div><div>0  libLLVM-2.8.so.1 0x01421628</div><div>Stack dump:</div><div>0.<span class="Apple-tab-span" style="white-space:pre">     </span>Program arguments: opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example6 </div>
<div>1.<span class="Apple-tab-span" style="white-space:pre">    </span>Running pass 'Function Pass Manager' on module '<stdin>'.</div><div>2.<span class="Apple-tab-span" style="white-space:pre">    </span>Running pass 'Module Verifier' on function '@main'</div>
<div>Aborted</div></div><div> </div><div><br></div><div>Any help</div><div>thanks</div></div>