<div dir="ltr">yes, thank you for your quick reply.<br><br><div class="gmail_quote">On Sat, May 9, 2009 at 10:38 PM, John Criswell <span dir="ltr"><<a href="mailto:criswell@uiuc.edu">criswell@uiuc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Rotem Varon wrote:<br>
> Hi,<br>
><br>
> Let say i am writing a code inside basic block pass and iterating all<br>
> the instructions inside,<br>
> and i encountered in this instruction :<br>
</div>If you're asking how to get the operands of an Instruction, use the<br>
getOperand() method:<br>
<br>
Value * Operand1 = I->getOperand(0);<br>
Value * Operand2 = I->getOperand(1);<br>
<br>
The LLVM doxygen documentation (<a href="http://llvm.org/doxygen/" target="_blank">http://llvm.org/doxygen/</a>) is an<br>
invaluable resource.  You may also want to read the Programmer's Guide<br>
(<a href="http://llvm.org/docs/ProgrammersManual.html" target="_blank">http://llvm.org/docs/ProgrammersManual.html</a>).<br>
<br>
Does this answer your question?<br>
<br>
-- John T.<br>
<div class="im"><br>
><br>
> %3 = add i32 %1, 2<br>
><br>
> I want to convert this instruction to something like this:<br>
><br>
> add R1, 2, R3<br>
><br>
> I know the opocode, but i what i need is, the operands %1 and 2 (in<br>
> this example).<br>
><br>
> I will be grateful if some one will tell me how to do so .<br>
<br>
</div>_______________________________________________<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>
</blockquote></div><br></div>