aboutsummaryrefslogtreecommitdiffstats
path: root/examples/Kaleidoscope/Chapter4/toy.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-02-11 19:15:20 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-02-11 19:15:20 +0000
commit42fc5586241ddc5948ffff67eefe8cb2690534a8 (patch)
treedc3abc48e8f27927157bb70c7975a83435274aeb /examples/Kaleidoscope/Chapter4/toy.cpp
parentbbe99362e54a310b337c905ddc2e62a641bdb293 (diff)
downloadexternal_llvm-42fc5586241ddc5948ffff67eefe8cb2690534a8.zip
external_llvm-42fc5586241ddc5948ffff67eefe8cb2690534a8.tar.gz
external_llvm-42fc5586241ddc5948ffff67eefe8cb2690534a8.tar.bz2
Make Kaleidoscope not link against the interpreter, since that didn't
work anyway (Interpreter::getPointerToFunction doesn't return a callable pointer), and improve the error message when an ExecutionEngine can't be created. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/Kaleidoscope/Chapter4/toy.cpp')
-rw-r--r--examples/Kaleidoscope/Chapter4/toy.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp
index cdc9d74..a2ddda2 100644
--- a/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/examples/Kaleidoscope/Chapter4/toy.cpp
@@ -1,6 +1,5 @@
#include "llvm/DerivedTypes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
@@ -573,7 +572,12 @@ int main() {
TheModule = new Module("my cool jit", Context);
// Create the JIT. This takes ownership of the module.
- TheExecutionEngine = EngineBuilder(TheModule).create();
+ std::string ErrStr;
+ TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create();
+ if (!TheExecutionEngine) {
+ fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str());
+ exit(1);
+ }
FunctionPassManager OurFPM(TheModule);