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.
llvm-svn: 95896
diff --git a/llvm/docs/tutorial/LangImpl4.html b/llvm/docs/tutorial/LangImpl4.html
index b1ee25a..70fd673 100644
--- a/llvm/docs/tutorial/LangImpl4.html
+++ b/llvm/docs/tutorial/LangImpl4.html
@@ -485,7 +485,7 @@
<div class="doc_code">
<pre>
# Compile
- g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit interpreter native` -O3 -o toy
+ g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
# Run
./toy
</pre>
@@ -502,7 +502,6 @@
<pre>
#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"
@@ -1075,7 +1074,12 @@
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);
diff --git a/llvm/docs/tutorial/LangImpl5.html b/llvm/docs/tutorial/LangImpl5.html
index 9706cf1..2b0450f 100644
--- a/llvm/docs/tutorial/LangImpl5.html
+++ b/llvm/docs/tutorial/LangImpl5.html
@@ -902,7 +902,6 @@
<pre>
#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"
@@ -1720,7 +1719,12 @@
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);
diff --git a/llvm/docs/tutorial/LangImpl6.html b/llvm/docs/tutorial/LangImpl6.html
index 4433450..5fae906 100644
--- a/llvm/docs/tutorial/LangImpl6.html
+++ b/llvm/docs/tutorial/LangImpl6.html
@@ -821,7 +821,6 @@
<pre>
#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"
@@ -1757,7 +1756,12 @@
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);
diff --git a/llvm/docs/tutorial/LangImpl7.html b/llvm/docs/tutorial/LangImpl7.html
index 211d14a..f0a03c3 100644
--- a/llvm/docs/tutorial/LangImpl7.html
+++ b/llvm/docs/tutorial/LangImpl7.html
@@ -1004,7 +1004,6 @@
<pre>
#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"
@@ -2105,7 +2104,12 @@
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);
diff --git a/llvm/examples/Kaleidoscope/Chapter4/Makefile b/llvm/examples/Kaleidoscope/Chapter4/Makefile
index 7bc742f..30162d9 100644
--- a/llvm/examples/Kaleidoscope/Chapter4/Makefile
+++ b/llvm/examples/Kaleidoscope/Chapter4/Makefile
@@ -10,6 +10,6 @@
TOOLNAME = Kaleidoscope-Ch4
EXAMPLE_TOOL = 1
-LINK_COMPONENTS := core jit interpreter native
+LINK_COMPONENTS := core jit native
include $(LEVEL)/Makefile.common
diff --git a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp
index cdc9d74..a2ddda2 100644
--- a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/llvm/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 @@
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);
diff --git a/llvm/examples/Kaleidoscope/Chapter5/Makefile b/llvm/examples/Kaleidoscope/Chapter5/Makefile
index 5a8355d..d1f5e20 100644
--- a/llvm/examples/Kaleidoscope/Chapter5/Makefile
+++ b/llvm/examples/Kaleidoscope/Chapter5/Makefile
@@ -10,6 +10,6 @@
TOOLNAME = Kaleidoscope-Ch5
EXAMPLE_TOOL = 1
-LINK_COMPONENTS := core jit interpreter native
+LINK_COMPONENTS := core jit native
include $(LEVEL)/Makefile.common
diff --git a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp
index 24f551f..da64b7e 100644
--- a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter5/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"
@@ -818,7 +817,12 @@
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);
diff --git a/llvm/examples/Kaleidoscope/Chapter6/Makefile b/llvm/examples/Kaleidoscope/Chapter6/Makefile
index de2d758..a5fbcbd 100644
--- a/llvm/examples/Kaleidoscope/Chapter6/Makefile
+++ b/llvm/examples/Kaleidoscope/Chapter6/Makefile
@@ -10,6 +10,6 @@
TOOLNAME = Kaleidoscope-Ch6
EXAMPLE_TOOL = 1
-LINK_COMPONENTS := core jit interpreter native
+LINK_COMPONENTS := core jit native
include $(LEVEL)/Makefile.common
diff --git a/llvm/examples/Kaleidoscope/Chapter6/toy.cpp b/llvm/examples/Kaleidoscope/Chapter6/toy.cpp
index f4b5b8c..4e719e3 100644
--- a/llvm/examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter6/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"
@@ -936,7 +935,12 @@
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);
diff --git a/llvm/examples/Kaleidoscope/Chapter7/Makefile b/llvm/examples/Kaleidoscope/Chapter7/Makefile
index 8911d52..6cec323 100644
--- a/llvm/examples/Kaleidoscope/Chapter7/Makefile
+++ b/llvm/examples/Kaleidoscope/Chapter7/Makefile
@@ -11,6 +11,6 @@
EXAMPLE_TOOL = 1
REQUIRES_RTTI := 1
-LINK_COMPONENTS := core jit interpreter native
+LINK_COMPONENTS := core jit native
include $(LEVEL)/Makefile.common
diff --git a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
index 951dfd8..7dd9eae 100644
--- a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter7/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"
@@ -1100,7 +1099,12 @@
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);