summaryrefslogtreecommitdiffstats
path: root/llvm/examples
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-17 16:48:44 +0000
committerChris Lattner <sabre@nondot.org>2009-06-17 16:48:44 +0000
commitd24df24527855232e7fc36440c35332313774f24 (patch)
treed36c2b7d59248b5742103f6da1d108d1ad26d961 /llvm/examples
parentf44da17824e6d539353cfcb15ec75d677a1494ba (diff)
downloadbcm5719-llvm-d24df24527855232e7fc36440c35332313774f24.tar.gz
bcm5719-llvm-d24df24527855232e7fc36440c35332313774f24.zip
make sure that JIT examples link in their appropriate target.
llvm-svn: 73613
Diffstat (limited to 'llvm/examples')
-rw-r--r--llvm/examples/BrainF/BrainFDriver.cpp3
-rw-r--r--llvm/examples/HowToUseJIT/HowToUseJIT.cpp4
-rw-r--r--llvm/examples/Kaleidoscope/toy.cpp3
-rw-r--r--llvm/examples/ParallelJIT/ParallelJIT.cpp6
4 files changed, 14 insertions, 2 deletions
diff --git a/llvm/examples/BrainF/BrainFDriver.cpp b/llvm/examples/BrainF/BrainFDriver.cpp
index 34fb8061772..06e77d2e2a3 100644
--- a/llvm/examples/BrainF/BrainFDriver.cpp
+++ b/llvm/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/llvm/examples/HowToUseJIT/HowToUseJIT.cpp b/llvm/examples/HowToUseJIT/HowToUseJIT.cpp
index b5c6d111914..a9f10009e1e 100644
--- a/llvm/examples/HowToUseJIT/HowToUseJIT.cpp
+++ b/llvm/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/llvm/examples/Kaleidoscope/toy.cpp b/llvm/examples/Kaleidoscope/toy.cpp
index bec430c41f5..c75014a69ba 100644
--- a/llvm/examples/Kaleidoscope/toy.cpp
+++ b/llvm/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/llvm/examples/ParallelJIT/ParallelJIT.cpp b/llvm/examples/ParallelJIT/ParallelJIT.cpp
index e812d84eafc..a6d7dcf7b55 100644
--- a/llvm/examples/ParallelJIT/ParallelJIT.cpp
+++ b/llvm/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");
OpenPOWER on IntegriCloud