[LLVMdev] Marking a function prototype as being "persistent"
Reid Kleckner
reid.kleckner at gmail.com
Thu Jan 6 09:24:26 PST 2011
On Thu, Jan 6, 2011 at 10:06 AM, Duncan Sands <baldrick at free.fr> wrote:
>> So my question is: what is the correct, officially recommended way to reference runtime functions so that global DCE won't get rid of them? Or am I supposed to re-create the corresponding Function instances for every translation?
>
> There's some kind of disconnect here, so you need to explain more :)
Presumably since he's using the JIT he's generating more code later
that uses the runtime functions, which he wants to be marked as
available.
The disconnect is wanting to apply whole-program/LTO type
optimizations before you have the whole program.
I think the answer is to not use the standard LTO passes and to create
your own versions that are careful not to do things like delete types
and prototypes that you might need later.
Reid
More information about the llvm-dev
mailing list