[LLVMdev] How can I get the destination operand of an instruction?
=?utf-8?Q?=C3=93scar_Fuentes?=
ofv at wanadoo.es
Tue May 8 20:14:22 PDT 2012
Launcher <st.liucheng at gmail.com> writes:
> I am able to access the source operands of an instruction using either
> getOperand() or op_iterator, However, I can't find any method available for
> destination operand. Someone suggests that instruction itself can represent
> the destination operand.
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-January/037518.html
That's correct: the llvm::Instruction itself represents the result of
the operation. Note that class llvm::Instruction derives from
llvm::Value through llvm::User.
> The getOperand() returns an unsigned value like 0x9063498,
Uh? User::getOperand returns a Value*.
> while I can't
> find any instruction's method that returns unsigned value. I have tried
> getValue(),
You mean Value::getValueID, don't you?
> but it actually returns the opcode of the instruction instead of
> a unique value of of an instruction instance.
>
> Anyone gives any suggestions about this?
Read again the message you linked at the beginning.
More information about the llvm-dev
mailing list