[LLVMdev] Kaleidoscope-tutorial: Fails to create the JIT

Reid Kleckner rnk at mit.edu
Fri Jan 22 12:55:49 PST 2010


On Fri, Jan 22, 2010 at 1:56 PM, ALbert Mietus <albert at ons-huis.net> wrote:
> Hello All
>
> I 'm studing LLVM/Clang and trying to follow the Kaleidoscope tutorial
> (Release 2.6 version).
> I found some minir docu-bugs and added them to Bugzilla.
>
> However, Now I found a show-stopper for me, the toy (v4) demo does
> build, but does crash, on any input. Even a simpe ';'!
> Looking into the (demo-code) found the that the JIT can't be build/
> created,/loaded/...
> Which result's in a null-pointer for "TheExecutionEngine"; which
> explains the bus-errror ..
>
> The main code is
>  || ...                                                                //GAM some setting of vars
>  ||  fprintf(stderr, "ready> ");
>  ||  getNextToken();
>  ||
>  || // Make the module, which holds all the code.
>  ||  TheModule = new Module("my cool jit", getGlobalContext());
>  ||  //GAM: check TheModule: it's a valid pointer
>  ||
>  ||  // create the JIT.
>  || TheExecutionEngine = EngineBuilder(TheModule).create();

Try changing the above line to:
  std::string str;
  TheExecutionEngine =
EngineBuilder(OurModuleProvider).setErrorStr(str).create();
  cout << str << '\n';

This interface should set str to an appropriate error message if it
returns NULL.

Reid




More information about the llvm-dev mailing list