From 8a30324e51241c40dc5d6dcc4278d0fec528fd41 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Thu, 11 Feb 2010 19:15:20 +0000 Subject: 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 --- llvm/docs/tutorial/LangImpl4.html | 10 +++++++--- llvm/docs/tutorial/LangImpl5.html | 8 ++++++-- llvm/docs/tutorial/LangImpl6.html | 8 ++++++-- llvm/docs/tutorial/LangImpl7.html | 8 ++++++-- 4 files changed, 25 insertions(+), 9 deletions(-) (limited to 'llvm/docs/tutorial') diff --git a/llvm/docs/tutorial/LangImpl4.html b/llvm/docs/tutorial/LangImpl4.html index b1ee25a88d1..70fd673d64b 100644 --- a/llvm/docs/tutorial/LangImpl4.html +++ b/llvm/docs/tutorial/LangImpl4.html @@ -485,7 +485,7 @@ LLVM JIT and optimizer. To build this example, use:
    # 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
 
@@ -502,7 +502,6 @@ at runtime.

 #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 @@ 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);
 
diff --git a/llvm/docs/tutorial/LangImpl5.html b/llvm/docs/tutorial/LangImpl5.html
index 9706cf1c2b0..2b0450fef98 100644
--- a/llvm/docs/tutorial/LangImpl5.html
+++ b/llvm/docs/tutorial/LangImpl5.html
@@ -902,7 +902,6 @@ if/then/else and for expressions..  To build this example, use:
 
 #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 @@ 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);
 
diff --git a/llvm/docs/tutorial/LangImpl6.html b/llvm/docs/tutorial/LangImpl6.html
index 4433450159f..5fae906c3b3 100644
--- a/llvm/docs/tutorial/LangImpl6.html
+++ b/llvm/docs/tutorial/LangImpl6.html
@@ -821,7 +821,6 @@ if/then/else and for expressions..  To build this example, use:
 
 #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 @@ 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);
 
diff --git a/llvm/docs/tutorial/LangImpl7.html b/llvm/docs/tutorial/LangImpl7.html
index 211d14a3f55..f0a03c3cc89 100644
--- a/llvm/docs/tutorial/LangImpl7.html
+++ b/llvm/docs/tutorial/LangImpl7.html
@@ -1004,7 +1004,6 @@ variables and var/in support.  To build this example, use:
 
 #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 @@ 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);
 
-- 
cgit v1.2.3