<div dir="ltr">If I1->getOperand(0) is the load, then %c is its pointer argument available with:<div><br></div><div style>LoadInst *LD = cast<LoadInst>(I1->getOperand(0));</div><div style>Value *C = LD->getPointerOperand();</div>
<div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 7:19 AM, Alexandru Ionut Diaconescu <span dir="ltr"><<a href="mailto:alexandruionutdiaconescu@gmail.com" target="_blank">alexandruionutdiaconescu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone !<br><br>In my LLVM pass, there is `Intruction* I1`. All the used "I1"s are ICMP instructions. *I1->getOperand(0) returns a `Value*` type. From<br>
<br>    errs()<<"\n"<<*I1->getOperand(0)<<"\n";<br>
    //printed : %3 = load i32* %c, align 4<br>Printed as expected. But I want to use %c. Do you know how I can get %c ? I need to use the value %c in some computations.<br><br>First, I tried<br><br>    for (llvm::Value::use_iterator VI=(*I1->getOperand(0)).use_begin(), VE=(*I1->getOperand(0)).use_end(); VI != VE ; ++VI)<br>

      {<br>        errs()<<"\n "<<**VI<<" \n";<br>        //printed : %cmp3 = icmp ne i32 %3, 0 <br>      }<br>But it is not getting Value* fields. Also, it is printing only one VI per for, so VI cannot increment.<br>

<br>Second, it is a solution of taking the output of errs() in a string and parse the string for %c ? If so, how I can do it? I have problems while trying to declare `static raw_ostream S` in order to take somehow the errs() output.<br>

<br>Thank you for any help !<span class="HOEnZb"><font color="#888888"><br>    <br clear="all"><br>-- <br><font style="color:rgb(153,153,153)">Best regards,</font><br style="color:rgb(153,153,153)">
<font style="color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</font></span><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" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
</div>