[llvm-dev] How to insert instructions before each function calls?

Dean Michael Berris via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 5 18:21:47 PDT 2016

> On 5 Sep 2016, at 16:14, SHUCAI YAO <yaos4 at mcmaster.ca> wrote:
> Hi Dean,
> Do you have any example for this?  I would like have a look at how you handle this in XRay if it is possible. 

Yes, this is all upstream -- if you look in lib/CodeGen/XRayInstrument.cpp and the associated lowering code for X86 in lib/Target/X86/X86MCInstLower.cpp and/or search for PATCHABLE_RET in include/... and lib/... then that should give you a better idea of how this works. :)


-- Dean

More information about the llvm-dev mailing list