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

Zhiyu Xie via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 18 03:42:27 PDT 2016


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>


More information about the llvm-dev mailing list