Sunday, 29 September 2013

LLVM official tutorial interpreter not working correctly

LLVM official tutorial interpreter not working correctly

I am following the official LLVM tutorial on how to implement a language,
using exactly the same code (I copy-pasted it, so I'm sure of that) as
given here http://llvm.org/docs/tutorial/LangImpl4.html#full-code-listing
and exactly the same line to build it:
clang++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit
native` -O3 -o toy -rdynamic
But when runnig ./toy the interpreter is giving the result of the last line:
ready> 1
ready> 1+2
Evaluated to 1.000000
ready> 2+3
Evaluated to 3.000000
ready> 3+4
Evaluated to 5.000000
ready> 1
Evaluated to 7.000000
ready> a
Evaluated to 1.000000
ready> 1
Error: Unknown variable name
ready>
How can I solve that?
Thank you

No comments:

Post a Comment