[LLVMdev] Getting MCInst "ins" and "outs"

Vladimir Pouzanov farcaller at gmail.com
Sun Dec 23 15:34:51 PST 2012

Hi all.

I'm looking for some way to do code analysis with LLVM. Can someone please give me a hint, if it is possible to query an MCInst for what are input operands and what are output operands?

Small example.

Consider we have an instruction:
  str r1, [sp, #8]

Being mapped into MCInst instance it has the following operands:
  <MCOperand Reg:61>     <-- maps to reg r1
  <MCOperand Reg:105>    <-- maps to reg sp
  <MCOperand Imm:8>      <-- maps to immed #8
  <MCOperand Imm:14>
  <MCOperand Reg:0>

Now, what are the two last operands (that are not actually present in disassembly)? And is it somehow possible to map the operands to OutOperandList/InOperandList found in the td definition?

Vladimir Pouzanov

More information about the llvm-dev mailing list