summaryrefslogtreecommitdiff
path: root/MLKLLVMCompiler.mm
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-09-09 00:38:55 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-09-09 00:38:55 +0200
commit5a396c3013c6555e85d9c4c51c5a83570873f6c9 (patch)
tree25d2c53c804a28e0f0d18561f3ecb342fe969370 /MLKLLVMCompiler.mm
parentffa34a44a7e040f3c165e8ed53358dfd6d9a9dc6 (diff)
LLVM: Ensure that JIT and native target code is linked into the executable.
Diffstat (limited to 'MLKLLVMCompiler.mm')
-rw-r--r--MLKLLVMCompiler.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm
index 643d177..c2007af 100644
--- a/MLKLLVMCompiler.mm
+++ b/MLKLLVMCompiler.mm
@@ -41,12 +41,14 @@
#include <llvm/DerivedTypes.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ExecutionEngine/GenericValue.h>
+#include <llvm/ExecutionEngine/JIT.h>
#include <llvm/Instructions.h>
//#include <llvm/Interpreter.h>
#include <llvm/Module.h>
#include <llvm/PassManager.h>
#include <llvm/Support/IRBuilder.h>
#include <llvm/Target/TargetData.h>
+#include <llvm/Target/TargetSelect.h>
#include <llvm/Transforms/Scalar.h>
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/Utils/Cloning.h> // InlineFunction
@@ -121,11 +123,12 @@ static Constant
PointerPointerTy = PointerType::get(VoidPointerTy, 0);
builder = new IRBuilder<true, ConstantFolder>(*llvm_context);
-
module = new llvm::Module ("MLKLLVMModule", *llvm_context);
+ InitializeNativeTarget();
+ std::string error;
//execution_engine = ExecutionEngine::create (module, true);
- execution_engine = ExecutionEngine::create (module, false);
+ execution_engine = ExecutionEngine::create (module, false, &error);
assert(execution_engine);
fpm = new FunctionPassManager (module);