Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load/enable MCJIT for LLVM 3.6 or newer
Browse files Browse the repository at this point in the history
Yorick Peterse committed Mar 28, 2015
1 parent 0fa85e6 commit 99bc4ee
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions vm/drivers/compile.cpp
Original file line number Diff line number Diff line change
@@ -31,7 +31,13 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/LinkAllPasses.h"
#include "llvm/ModuleProvider.h"

#if RBX_LLVM_API_VER >= 306
#include "llvm/ExecutionEngine/MCJIT.h"
#else
#include "llvm/ExecutionEngine/JIT.h"
#endif

#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include <llvm/Support/CommandLine.h>
4 changes: 4 additions & 0 deletions vm/llvm/jit_context.cpp
Original file line number Diff line number Diff line change
@@ -81,6 +81,10 @@ namespace rubinius {
factory.setEngineKind(EngineKind::JIT);
factory.setErrorStr(&error);

#if RBX_LLVM_API_VER >= 306
factory.setUseMCJIT(true);
#endif

#if RBX_LLVM_API_VER > 300
llvm::TargetOptions opts;
opts.NoFramePointerElim = true;
8 changes: 7 additions & 1 deletion vm/llvm/state.hpp
Original file line number Diff line number Diff line change
@@ -24,7 +24,13 @@
#else
#include <llvm/Support/IRBuilder.h>
#endif
#include <llvm/ExecutionEngine/JIT.h>

#if RBX_LLVM_API_VER >= 306
#include "llvm/ExecutionEngine/MCJIT.h"
#else
#include "llvm/ExecutionEngine/JIT.h"
#endif

#include <llvm/CodeGen/MachineCodeInfo.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <llvm/Pass.h>

0 comments on commit 99bc4ee

Please sign in to comment.