[cfe-dev] Accessing all the variables in an Instruction

David Blaikie dblaikie at gmail.com
Sun Nov 4 16:29:50 PST 2012

On Sun, Nov 4, 2012 at 5:33 AM, era jain <iru19.jain at gmail.com> wrote:
> Hi,
> Can anyone tell me how can I access the defining variable in an instruction?
> For example:
> %rem = srem i32 %i.0, 10
> Using getOperand() in the above instruction gives me only the operands on
> the LHS, i.e. i.0 and i32 10. How can I access %rem?

Because LLVM IR is in SSA form, the instruction /is/ the 'defining
variable', there is no distinction between the two. Just ask the
instruction for its name.

- David

More information about the cfe-dev mailing list