Yes, Duncan is right. You can use ("malloc i8, i32 %n") as a value<br>to mark its uses.<br><br>   cheers,<br><br>   Liu Jian<br>----<br>email to: <a href="mailto:gjk.liu@gmail.com">gjk.liu@gmail.com</a><br>
<br><br><div class="gmail_quote">On Tue, Apr 6, 2010 at 5:03 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Qiuping yi,<br>
<div class="im"><br>
> I am a new novice of LLVM, and I want know how to get the left-hand<br>
> operand of an instruction?<br>
><br>
> For example:<br>
> how to get the %temp2 operand in the next instruction:<br>
><br>
> %temp2 = malloc i8, i32 %n<br>
<br>
</div>there is no left-hand side, temp2 is just a name for the instruction.<br>
Since the LLVM IR is in SSA form, registers have exactly one definition,<br>
and thus there is no point in distinguishing between a register and the<br>
instruction that defines it.  In short, whenever you would like to make<br>
use of "%temp2", just use the instruction ("malloc i8, i32 %n") directly.<br>
<br>
Ciao,<br>
<br>
Duncan.<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>
</blockquote></div><br>