From 6fe5c7aa327e188b7176daa5595bbf075a6b94df Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Tue, 16 Feb 2010 09:30:23 +0000 Subject: Update LLVM to r96341. --- docs/tutorial/LangImpl1.html | 2 +- docs/tutorial/LangImpl2.html | 2 +- docs/tutorial/LangImpl3.html | 2 +- docs/tutorial/LangImpl4.html | 49 ++++++++++++++++----------------------- docs/tutorial/LangImpl5.html | 18 +++++++------- docs/tutorial/LangImpl6.html | 18 +++++++------- docs/tutorial/LangImpl7.html | 18 +++++++------- docs/tutorial/LangImpl8.html | 2 +- docs/tutorial/OCamlLangImpl1.html | 2 +- docs/tutorial/OCamlLangImpl2.html | 2 +- docs/tutorial/OCamlLangImpl3.html | 2 +- docs/tutorial/OCamlLangImpl4.html | 2 +- docs/tutorial/OCamlLangImpl5.html | 2 +- docs/tutorial/OCamlLangImpl6.html | 2 +- docs/tutorial/OCamlLangImpl7.html | 2 +- 15 files changed, 58 insertions(+), 67 deletions(-) (limited to 'docs/tutorial') diff --git a/docs/tutorial/LangImpl1.html b/docs/tutorial/LangImpl1.html index 5e1786cb00be7..9f4737d39f848 100644 --- a/docs/tutorial/LangImpl1.html +++ b/docs/tutorial/LangImpl1.html @@ -342,7 +342,7 @@ so that you can use the lexer and parser together. Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/LangImpl2.html b/docs/tutorial/LangImpl2.html index 5bcd0dd2c7ff2..f06db16e67fd0 100644 --- a/docs/tutorial/LangImpl2.html +++ b/docs/tutorial/LangImpl2.html @@ -1227,7 +1227,7 @@ int main() { Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/LangImpl3.html b/docs/tutorial/LangImpl3.html index e3d2117c4e686..a628145dc3cc8 100644 --- a/docs/tutorial/LangImpl3.html +++ b/docs/tutorial/LangImpl3.html @@ -1263,7 +1263,7 @@ int main() { Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2009-07-21 11:05:13 -0700 (Tue, 21 Jul 2009) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/LangImpl4.html b/docs/tutorial/LangImpl4.html index 728d518a473bf..85e48c5f89e3f 100644 --- a/docs/tutorial/LangImpl4.html +++ b/docs/tutorial/LangImpl4.html @@ -171,10 +171,7 @@ add a set of optimizations to run. The code looks like this:

-  ExistingModuleProvider *OurModuleProvider =
-      new ExistingModuleProvider(TheModule);
-
-  FunctionPassManager OurFPM(OurModuleProvider);
+  FunctionPassManager OurFPM(TheModule);
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
@@ -198,19 +195,13 @@ add a set of optimizations to run.  The code looks like this:

-

This code defines two objects, an ExistingModuleProvider and a -FunctionPassManager. The former is basically a wrapper around our -Module that the PassManager requires. It provides certain flexibility -that we're not going to take advantage of here, so I won't dive into any details -about it.

- -

The meat of the matter here, is the definition of "OurFPM". It -requires a pointer to the Module (through the ModuleProvider) -to construct itself. Once it is set up, we use a series of "add" calls to add -a bunch of LLVM passes. The first pass is basically boilerplate, it adds a pass -so that later optimizations know how the data structures in the program are -laid out. The "TheExecutionEngine" variable is related to the JIT, -which we will get to in the next section.

+

This code defines a FunctionPassManager, "OurFPM". It +requires a pointer to the Module to construct itself. Once it is set +up, we use a series of "add" calls to add a bunch of LLVM passes. The first +pass is basically boilerplate, it adds a pass so that later optimizations know +how the data structures in the program are laid out. The +"TheExecutionEngine" variable is related to the JIT, which we will get +to in the next section.

In this case, we choose to add 4 optimization passes. The passes we chose here are a pretty standard set of "cleanup" optimizations that are useful for @@ -302,8 +293,8 @@ by adding a global variable and a call in main:

... int main() { .. - // Create the JIT. This takes ownership of the module and module provider. - TheExecutionEngine = EngineBuilder(OurModuleProvider).create(); + // Create the JIT. This takes ownership of the module. + TheExecutionEngine = EngineBuilder(TheModule).create(); .. } @@ -494,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
 
@@ -511,11 +502,9 @@ 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"
-#include "llvm/ModuleProvider.h"
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Target/TargetData.h"
@@ -1084,13 +1073,15 @@ int main() {
   // Make the module, which holds all the code.
   TheModule = new Module("my cool jit", Context);
 
-  ExistingModuleProvider *OurModuleProvider =
-      new ExistingModuleProvider(TheModule);
-
-  // Create the JIT.  This takes ownership of the module and module provider.
-  TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
+  // Create the JIT.  This takes ownership of the module.
+  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(OurModuleProvider);
+  FunctionPassManager OurFPM(TheModule);
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
@@ -1135,7 +1126,7 @@ int main() {
 
   Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html index f93b59be0dcac..f80f3f3f055d1 100644 --- a/docs/tutorial/LangImpl5.html +++ b/docs/tutorial/LangImpl5.html @@ -902,11 +902,9 @@ 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"
-#include "llvm/ModuleProvider.h"
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Target/TargetData.h"
@@ -1720,13 +1718,15 @@ int main() {
   // Make the module, which holds all the code.
   TheModule = new Module("my cool jit", Context);
 
-  ExistingModuleProvider *OurModuleProvider =
-      new ExistingModuleProvider(TheModule);
-
-  // Create the JIT.  This takes ownership of the module and module provider.
-  TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
+  // Create the JIT.  This takes ownership of the module.
+  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(OurModuleProvider);
+  FunctionPassManager OurFPM(TheModule);
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
@@ -1771,7 +1771,7 @@ int main() {
 
   Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html index f113e96651e99..f70bc501fe5c7 100644 --- a/docs/tutorial/LangImpl6.html +++ b/docs/tutorial/LangImpl6.html @@ -821,11 +821,9 @@ 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"
-#include "llvm/ModuleProvider.h"
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Target/TargetData.h"
@@ -1757,13 +1755,15 @@ int main() {
   // Make the module, which holds all the code.
   TheModule = new Module("my cool jit", Context);
 
-  ExistingModuleProvider *OurModuleProvider =
-      new ExistingModuleProvider(TheModule);
-
-  // Create the JIT.  This takes ownership of the module and module provider.
-  TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
+  // Create the JIT.  This takes ownership of the module.
+  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(OurModuleProvider);
+  FunctionPassManager OurFPM(TheModule);
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
@@ -1808,7 +1808,7 @@ int main() {
 
   Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html index ec07fa88d4b14..1a779baf99427 100644 --- a/docs/tutorial/LangImpl7.html +++ b/docs/tutorial/LangImpl7.html @@ -1004,11 +1004,9 @@ 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"
-#include "llvm/ModuleProvider.h"
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Target/TargetData.h"
@@ -2105,13 +2103,15 @@ int main() {
   // Make the module, which holds all the code.
   TheModule = new Module("my cool jit", Context);
 
-  ExistingModuleProvider *OurModuleProvider =
-      new ExistingModuleProvider(TheModule);
-
-  // Create the JIT.  This takes ownership of the module and module provider.
-  TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
+  // Create the JIT.  This takes ownership of the module.
+  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(OurModuleProvider);
+  FunctionPassManager OurFPM(TheModule);
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
@@ -2158,7 +2158,7 @@ int main() {
 
   Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ diff --git a/docs/tutorial/LangImpl8.html b/docs/tutorial/LangImpl8.html index 855b8f3692bff..5effd70458d2d 100644 --- a/docs/tutorial/LangImpl8.html +++ b/docs/tutorial/LangImpl8.html @@ -359,7 +359,7 @@ Passing Style and the use of tail calls (which LLVM also supports).

Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl1.html b/docs/tutorial/OCamlLangImpl1.html index 3c0fd8b1c690e..f3345aaca6bb8 100644 --- a/docs/tutorial/OCamlLangImpl1.html +++ b/docs/tutorial/OCamlLangImpl1.html @@ -359,7 +359,7 @@ include a driver so that you can use the lexer and parser together. Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl2.html b/docs/tutorial/OCamlLangImpl2.html index 7d60aa6f9fdfb..a59e829de61c9 100644 --- a/docs/tutorial/OCamlLangImpl2.html +++ b/docs/tutorial/OCamlLangImpl2.html @@ -1039,7 +1039,7 @@ main () Chris Lattner Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl3.html b/docs/tutorial/OCamlLangImpl3.html index a59887522ee50..b3351477ac3d8 100644 --- a/docs/tutorial/OCamlLangImpl3.html +++ b/docs/tutorial/OCamlLangImpl3.html @@ -1085,7 +1085,7 @@ main () Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl4.html b/docs/tutorial/OCamlLangImpl4.html index 543e12fe25b26..451ab11261fdc 100644 --- a/docs/tutorial/OCamlLangImpl4.html +++ b/docs/tutorial/OCamlLangImpl4.html @@ -1032,7 +1032,7 @@ extern double putchard(double X) { Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl5.html b/docs/tutorial/OCamlLangImpl5.html index f19e900c00bdd..ae075ec259b0a 100644 --- a/docs/tutorial/OCamlLangImpl5.html +++ b/docs/tutorial/OCamlLangImpl5.html @@ -1563,7 +1563,7 @@ operators Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl6.html b/docs/tutorial/OCamlLangImpl6.html index 2edb22edf632a..e0503c0880c74 100644 --- a/docs/tutorial/OCamlLangImpl6.html +++ b/docs/tutorial/OCamlLangImpl6.html @@ -1568,7 +1568,7 @@ SSA construction Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ diff --git a/docs/tutorial/OCamlLangImpl7.html b/docs/tutorial/OCamlLangImpl7.html index 07768214b9a5a..ed1a558e3ae08 100644 --- a/docs/tutorial/OCamlLangImpl7.html +++ b/docs/tutorial/OCamlLangImpl7.html @@ -1901,7 +1901,7 @@ extern double printd(double X) { Chris Lattner
The LLVM Compiler Infrastructure
Erick Tryzelaar
- Last modified: $Date: 2007-10-17 11:05:13 -0700 (Wed, 17 Oct 2007) $ + Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ -- cgit v1.3