[llvm-dev] Execution

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 16 12:50:30 PDT 2017


On 16 June 2017 at 12:19, Samaneh Berenjian via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I have written a code in llvmlite. Using command numba --dump-llvm
> example.py > example.ll I can have .ll file. However, using lli example.ll,
> I am stopped with error: 'main' function not found in module. Is there
> anyway at which it can be executed using lli?

By default lli looks for a function named @main since that's the
traditional C and C++ entry point (amongst others these days). You can
override that and tell it to execute an arbitrary function with  the
"-entry-function" argument. Probably wise to make sure the prototype
matches main though (i.e. return and int and take either northing or
an argc, argv pair).

Cheers.

Tim.


More information about the llvm-dev mailing list