<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;">
<div><div></div><div class="h5">Hi Nabila,<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
        Now when i tried this pass an error says:<br>
        Wrong type for attribute noalias<br>
        tail call void @consume(i32 noalias 3, i32* @y) nounwind<br>
<br>
<br>
    noalias is only for arguments of pointer type.  You probably meant it to<br>
    be on the second argument rather than the first.  I suggest you correct<br>
    your code that adds the attribute.<br>
<br>
    Ciao, Duncan.<br>
<br>
<br>
no my fucntion is<br>
void consume(int nb_into_bloc, int *nb_total)<br>
the second is a pointer<br>
here is how I pass the parameters<br>
  Instruction* ii = i->getTerminator();<br>
  const int n = cast <int> (i->size());<br>
  ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n);<br>
  std::vector<Value*> int32_16_params;<br>
  int32_16_params.push_back(inValue);<br>
  int32_16_params.push_back(gvar_int32_y);<br>
  CallInst* int32_16 = CallInst::Create(func_consume, int32_16_params.begin(),<br>
int32_16_params.end(), "", ii);<br>
</blockquote>
<br></div></div>
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></blockquote><div><br></div><div>i have written a module pass and i have compiled it and then </div><div><div> opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2 < hello.bc > /dev/null</div>
</div><div>i get the error message </div><div><div>Wrong type for attribute noalias</div><div>  tail call void @consume(i32 noalias 3, i32* @y) nounwind</div><div>Broken module found, compilation aborted!</div><div>0  libLLVM-2.8.so.1 0x019bc628</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 -Example2 </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><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Ciao, Duncan.<br>
</blockquote></div><br></div>