Instruction Operands

Working with the LLVM source, if I have an Instruction object by itself (created by parsing a module using LLVM's parser), is there a way to get its operands/destination?

e.g. '%add = add nsw i32 %tmp2, %tmp1'
Being able to get some form of %add, %tmp2, and %tmp1?

All I can pull is the operation itself, i.e. that it's an add.

Thanks,
Brandon

Hi Brandon,

Firstly, "%add" is the Instruction object itself - an instruction is its own
return value.

Secondly, getOperand(int i) is what you want:
http://llvm.org/docs/doxygen/html/User_8h_source.html#l00086.

Cheers,

James