[LLVMdev] Instantiating a JIT on win64

Nicholas Lester nicholas.maxwell.lester at gmail.com
Tue Jun 21 14:13:23 PDT 2011


hi all,

I'm trying to write an LLVM-based interpreter for a small DSL that we have.
The language is very simple (essentially a calculator), but I'd like it to
execute efficiently.  I've been following the tutorial, and have the
following code for instantiating an ExecutionEngine:

            #include <LLVM\ExecutionEngine\JIT.h>
            #include <LLVM\ExecutionEngine\Interpreter.h>

            // ...

            std::string builderErr;
            llvm::EngineBuilder engineBuilder(&m_state.GetModule());
            engineBuilder.setErrorStr(&builderErr);
            m_engine = engineBuilder.create();

Unfortunately, i can't seem to instantiate a JIT.  I can get into the
JIT::createJIT function, but i then fail to find an appropriate JIT for my
architecture (which is actually X86_64-win64, via visual c++ compilation.  I
also had to fiddle around to get LLVM 2.9 to compile under the custom build
system I'm working with).  The JIT::selectTarget call infers a triple of
"x86_64-pc-win32", which then fails to find a target machine.
Interestingly, the TargetRegistry appears to be empty, which doesn't seem
right (maybe i haven't linked in a library that populates this?).  I also
tried specifying MCPU as "X86_64"/"X86" and MArch as "win64"/"w64"/"win32"
using EngineBuilder functions, which didn't help.

Can anyone tell me what the correct MArch/MCPU strings are for my machine,
and why the current code is not able to infer it?

thanks

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110621/a982af0c/attachment.html>


More information about the llvm-dev mailing list