[LLVMdev] C/C++ interpreter...

Eli Friedman eli.friedman at gmail.com
Wed Jun 18 23:43:07 PDT 2008

On Wed, Jun 18, 2008 at 5:42 AM, Fons Rademakers
<Fons.Rademakers at cern.ch> wrote:
> Hi,
>   what would be needed to make a C/C++ interpreter using the LLVM
> libraries.

See http://llvm.org/docs/tutorial/.  Essentially, what's required is
a converter from whatever internal representation you use into LLVM
IR, and a bit of glue code to actually execute the generated code.

> We have in our project (http://root.cern.ch) a C/C++ interpreter
> (http://root.cern.ch/twiki/bin/view/ROOT/CINT), but it has some limitations
> (the biggest being maintenance). I see there is a libLLVMInterpreter that
> can interpret the LLVM IR. Could this be used to interpret, or a starting
> point, to an real interpreter ?

I have no idea what you mean by a real interpreter.  LLVM IR is a
(low-level) language; there are libraries in the LLVM tree for static
compilation, interpretation, and JIT.  There's also a command-line
tool, called lli, which can interpret and JIT LLVM IR.

clang (http://clang.llvm.org) might also be of interest.


More information about the llvm-dev mailing list