<div dir="ltr"><br><br><div class="gmail_quote">2011/4/26 Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Nabila,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
where did the "noalias" attribute and "tail call" (rather than "call") come<br>
from? Are you setting these yourself or running some optimization pass after<br>
your pass?<br>
<br>
<br>
i have written a module pass and i have compiled it and then<br>
</blockquote>
<br></div>
you didn't answer my questions, you just repeated what you said before.<br>
<br>
Ciao, Duncan.<div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2 <<br>
hello.bc > /dev/null<br>
i get the error message<br>
Wrong type for attribute noalias<br>
tail call void @consume(i32 noalias 3, i32* @y) nounwind<br>
Broken module found, compilation aborted!<br>
0 libLLVM-2.8.so.1 0x019bc628<br>
Stack dump:<br>
0.Program arguments: opt -load<br>
/home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2<br>
1.Running pass 'Function Pass Manager' on module '<stdin>'.<br>
2.Running pass 'Module Verifier' on function '@main'<br>
Aborted<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><div class="im" style="color: rgb(80, 0, 80); ">
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
No, i'm not setting them by my self<br></blockquote><br></div>and are you running any optimization passes? Another possibility is that the<br>the problem was present already in hello.bc. Did you check that hello.bc passes<br>
the verifier? Did you build LLVM with assertions enabled (you should)? How did<br>you add the declaration of "consume" to the module? Finally, try running under<br>valgrind.<br></span>
<br></blockquote></div></div></blockquote><div><br></div><div>no I do not use any optimisation pass only my pass</div><div>hello.bc works and i have check it with lli hello.bc</div><div>no without assertion enabled</div>
<div>i don't want to modify the original hello.bc</div><div>if would like to apply the changes found in the pass i just put instead of this</div><div>opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2 < hello.bc > /dev/null</div>
<div>i put this</div><div>opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2 < hello.bc > hello2.bc</div><div><br></div><div>the declaration is:</div><div><br></div><div><div>PointerType* PointerTy_0 = PointerType::get(IntegerType::get(M.getContext(), 32), 0);</div>
<div><br></div><div><br></div><div> std::vector<const Type*>FuncTy_3_args;</div><div> FuncTy_3_args.push_back(IntegerType::get(M.getContext(), 32));</div><div> FuncTy_3_args.push_back(PointerTy_0);</div>
<div> FunctionType* FuncTy_3 = FunctionType::get(</div><div> /*Result=*/Type::getVoidTy(M.getContext()),</div><div> /*Params=*/FuncTy_3_args,</div><div> /*isVarArg=*/false);</div>
</div><div><br></div><div><br></div><div><br></div><div><div> Constant *consum = M.getOrInsertFunction("consume", FuncTy_3);</div><div> llvm::Function* func_consume = llvm::cast<llvm::Function > (consum);</div>
<div> func_consume ->setLinkage(GlobalValue::ExternalLinkage);</div><div> func_consume->setCallingConv(CallingConv::C);</div><div> AttrListPtr func_consume_PAL;</div><div> func_consume->setAttributes(func_consume_PAL);</div>
</div><div><br></div><div>i have tried to modify the method consume so that it is </div><div>void consume(int*)</div><div>and chaged the declaration also </div><div>and it works</div><div>now when i have modified the method consume like this void consume(int)</div>
<div>and modified the declaration</div><div>it doesn't work</div><div><br></div><div>I don't know valgrid:(</div><div><br></div><div>Sorry I always forget to clic the reply all :) </div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ciao, Duncan.<br>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>