summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);