Adarsh Yoga
2010-Apr-19 02:17 UTC
[LLVMdev] Method to obtain the Variable allocation instruction
Hi, I am parsing through each instruction and for each value in the instruction, I want the instruction that is defining/allocating the value being used here (the dominator instruction). Is there a method to do that? -- Adarsh Yoga Graduate Student, Computer Science Indiana University, Bloomington -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100418/8bd75a36/attachment.html>
Duncan Sands
2010-Apr-19 08:11 UTC
[LLVMdev] Method to obtain the Variable allocation instruction
Hi Adarsh,> I am parsing through each instruction and for each value in the > instruction, I want the instruction that is defining/allocating the > value being used here (the dominator instruction). Is there a method to > do that?I'm not sure what you mean by "each value in the instruction". Operands perhaps? Operands can be instructions or constants (or metadata in some cases). You can check whether operand Op is an instruction by doing: isa<Instruction>(Op). If so, you can cast it to an instruction using: cast<Instruction>(Op). Ciao, Duncan.