[llvm-dev] How to modify the calling convention

SHUCAI YAO via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 8 12:23:36 PDT 2016


I'm trying to implement something similar to this: http://gcc.gnu.org/wiki/
SplitStacks in LLVM.
What I'm hoping to do is to be able to inject the following code (in x86
asm, callee clean-up calling convention):

for each function call:
  lea %foo_return, %eax
  mov %eax, [%esp - calleestackframesize]
  push arg1
  push arg2
  push ...
  jmp foo
foo_return:
  ...

The problem I have is how to force the LLVM to generates the previous code.
How could I modify the calling sequence?

Any suggestions are appreciated.

Thanks!
Shucai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160808/9d872b3f/attachment.html>


More information about the llvm-dev mailing list