diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-22 08:08:12 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-22 08:08:12 +0000 |
| commit | b2f21fb044b6b5c52cff6227f9f79ca4ed42b18f (patch) | |
| tree | 86c1bc482baa6c81fc70b8d715153bfa93377186 /examples | |
| parent | 600c6fa13de5c407dc36dbb0ab73807868741ae0 (diff) | |
Notes
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/BrainF/BrainFDriver.cpp | 3 | ||||
| -rw-r--r-- | examples/HowToUseJIT/HowToUseJIT.cpp | 4 | ||||
| -rw-r--r-- | examples/Kaleidoscope/toy.cpp | 3 | ||||
| -rw-r--r-- | examples/ParallelJIT/ParallelJIT.cpp | 6 |
4 files changed, 14 insertions, 2 deletions
diff --git a/examples/BrainF/BrainFDriver.cpp b/examples/BrainF/BrainFDriver.cpp index 34fb80617722..06e77d2e2a3e 100644 --- a/examples/BrainF/BrainFDriver.cpp +++ b/examples/BrainF/BrainFDriver.cpp @@ -34,6 +34,7 @@ #include "llvm/ExecutionEngine/JIT.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Target/TargetSelect.h" #include <fstream> #include <iostream> using namespace llvm; @@ -135,6 +136,8 @@ int main(int argc, char **argv) { //Write it out if (JIT) { + InitializeNativeTarget(); + std::cout << "------- Running JIT -------\n"; ExistingModuleProvider *mp = new ExistingModuleProvider(mod); ExecutionEngine *ee = ExecutionEngine::create(mp, false); diff --git a/examples/HowToUseJIT/HowToUseJIT.cpp b/examples/HowToUseJIT/HowToUseJIT.cpp index b5c6d111914f..a9f10009e1ec 100644 --- a/examples/HowToUseJIT/HowToUseJIT.cpp +++ b/examples/HowToUseJIT/HowToUseJIT.cpp @@ -42,11 +42,15 @@ #include "llvm/ExecutionEngine/JIT.h" #include "llvm/ExecutionEngine/Interpreter.h" #include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/Target/TargetSelect.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; int main() { + + InitializeNativeTarget(); + // Create some module to put our function into it. Module *M = new Module("test"); diff --git a/examples/Kaleidoscope/toy.cpp b/examples/Kaleidoscope/toy.cpp index bec430c41f5a..c75014a69ba4 100644 --- a/examples/Kaleidoscope/toy.cpp +++ b/examples/Kaleidoscope/toy.cpp @@ -5,6 +5,7 @@ #include "llvm/PassManager.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Target/TargetData.h" +#include "llvm/Target/TargetSelect.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Support/IRBuilder.h" #include <cstdio> @@ -1081,6 +1082,8 @@ double printd(double X) { //===----------------------------------------------------------------------===// int main() { + InitializeNativeTarget(); + // Install standard binary operators. // 1 is lowest precedence. BinopPrecedence['='] = 2; diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp index e812d84eafc8..a6d7dcf7b556 100644 --- a/examples/ParallelJIT/ParallelJIT.cpp +++ b/examples/ParallelJIT/ParallelJIT.cpp @@ -26,6 +26,7 @@ #include "llvm/ExecutionEngine/JIT.h" #include "llvm/ExecutionEngine/Interpreter.h" #include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/Target/TargetSelect.h" #include <iostream> using namespace llvm; @@ -229,8 +230,9 @@ void* callFunc( void* param ) return (void*)(intptr_t)gv.IntVal.getZExtValue(); } -int main() -{ +int main() { + InitializeNativeTarget(); + // Create some module to put our function into it. Module *M = new Module("test"); |
