[llvm-dev] Insert function definition at the top of the module

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue May 23 09:15:32 PDT 2017


On 23 May 2017 at 08:32, Jajoo, Malhar via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> While I'm doing this , i need to codegen the function definition at the top
> of the module, in order for my function call to execute correctly.

Why do you think your function has to be at the top? LLVM IR doesn't
care about seeing declarations before uses and you shouldn't be able
to write anything well-defined to even know what order the functions
are in at runtime (the linker might reorder them on a whim for
example).

Cheers.

Tim.


More information about the llvm-dev mailing list