[llvm-dev] Serializing a single function to disk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Serializing a single function to disk

Muhui Jiang via llvm-dev
I would like to generate a free function that can be written to disk
and then I can mmap it later.

The function I'm going to generate is highly restrictive. It will use
the host C calling convention. It features no global variables, no
data references outside parameters and local variables.The parameters
to the function are all pointer sized integers. No exceptions support
required.

Call instructions emitted inside the code will always be done through
a dispatch that is based on a parameter, i.e. some sort of vtable or
interface dispatch whose setup is take care a priori.

I'm expecting that LLVM will generate code that given my restrictions
will be something I can mmap to any suitable aligned address and call
into.

I haven't tried all of the above, but I intend to soon. I'm emailing
this list in the hopes that somebody has done this before and can tell
me it won't work or work with some suitable options set, etc.
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev