[llvm-dev] How to insert a function call after certain instructions for x86 backend

Zhiyu Xie via llvm-dev
Fri, 18 Mar 2016 10:42:27 -0000

Hi all,
      I am trying to instrument a program to insert a function call
after SP-Update
instructions. SP-Update instructions are those modify the esp register such
as mov esp, eax ; xchg eax, esp ; add esp, [eax+0x20] and so on. It seems
that I should dig into the back end. But which representation of
instructions should I focus on? MachineInstr or MCInst or other class? Where
is the definitions of all opcodes and registers? In which part of the back
end should I inspect the instructions?  And How to insert a function call?
May I use MachineInstrBuilder::BuildMI ? I am so sorry to ask so many
questions because I am a newbie to LLVM. I would appreciate it if any one
coulld help me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20160318/9b7aac3a/attachment.html>