make sure that JIT examples link in their appropriate target.
authorChris Lattner <sabre@nondot.org>
Wed, 17 Jun 2009 16:48:44 +0000 (16:48 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Jun 2009 16:48:44 +0000 (16:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73613 91177308-0d34-0410-b5e6-96231b3b80d8

examples/BrainF/BrainFDriver.cpp
examples/HowToUseJIT/HowToUseJIT.cpp
examples/Kaleidoscope/toy.cpp
examples/ParallelJIT/ParallelJIT.cpp

index 34fb80617722cf97cd2a2d71f41405a8418ff702..06e77d2e2a3ec2a6338490d0ecc6d3d4fe08eab6 100644 (file)
@@ -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);
index b5c6d111914f36cc482efd76bd0ff7fd2addcf83..a9f10009e1eca9057d4e588525d4abc3815e856f 100644 (file)
 #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");
 
index bec430c41f5adfec790252b66fb650c00ecf7157..c75014a69ba40ff632fc1c811a62224e0ec7d723 100644 (file)
@@ -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;
index e812d84eafc85a8ef254414f0caaf02e74746b9e..a6d7dcf7b556c0d8fde244f03e0c1e3aec857c4e 100644 (file)
@@ -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");