Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2045 from Gibheer/new_llvm_version

changes to work with llvm 3.2
  • Loading branch information...
commit 192e1af04f6d3e04cbe5b7b01fe5685adec48eb5 2 parents 55fad50 + d67a3b0
@dbussink dbussink authored
View
5 vm/llvm/autotypes.cpp
@@ -1,6 +1,11 @@
#ifdef ENABLE_LLVM
+#include "vm/config.h"
+#if RBX_LLVM_API_VER >= 302
+#include <llvm/DataLayout.h>
+#else
#include <llvm/Target/TargetData.h>
+#endif
// #include <llvm/LinkAllPasses.h>
#include <llvm/Analysis/Verifier.h>
#include <llvm/Transforms/Scalar.h>
View
6 vm/llvm/inline_primitive.cpp
@@ -646,7 +646,7 @@ namespace rubinius {
sig << "State";
Function* func = sig.function("rbx_float_allocate");
- func->setDoesNotAlias(0, true); // return value
+ func->setDoesNotAlias(0); // return value
Value* call_args[] = { ops.vm() };
CallInst* res = sig.call("rbx_float_allocate", call_args, 1, "result", ops.b());
@@ -1091,10 +1091,10 @@ namespace rubinius {
}
Function* func = sig.function(stub_res.name());
- func->setDoesNotCapture(1, true);
+ func->setDoesNotCapture(1);
if(stub_res.pass_callframe()) {
- func->setDoesNotCapture(2, true);
+ func->setDoesNotCapture(2);
}
Value* res = sig.call(stub_res.name(), call_args, "prim_value", ops_.b());
View
8 vm/llvm/jit_block.cpp
@@ -460,13 +460,13 @@ namespace jit {
};
Function* func = sig.function("rbx_construct_splat");
- func->setOnlyReadsMemory(true);
- func->setDoesNotThrow(true);
+ func->setOnlyReadsMemory();
+ func->setDoesNotThrow();
CallInst* splat_val = sig.call("rbx_construct_splat", call_args, 4, "splat_val", b());
- splat_val->setOnlyReadsMemory(true);
- splat_val->setDoesNotThrow(true);
+ splat_val->setOnlyReadsMemory();
+ splat_val->setDoesNotThrow();
Value* idx3[] = {
cint(0),
View
4 vm/llvm/jit_builder.cpp
@@ -552,8 +552,8 @@ namespace jit {
sig << "CallFrame";
Function* func_ci = sig.function("rbx_check_interrupts");
- func_ci->setDoesNotCapture(1, true);
- func_ci->setDoesNotCapture(2, true);
+ func_ci->setDoesNotCapture(1);
+ func_ci->setDoesNotCapture(2);
Value* call_args[] = { info_.vm(), call_frame };
View
4 vm/llvm/jit_builder.hpp
@@ -6,7 +6,11 @@
#include "llvm/basic_block.hpp"
#include "llvm/inline_block.hpp"
#include "llvm/offset.hpp"
+#if RBX_LLVM_API_VER >= 302
+#include <llvm/IRBuilder.h>
+#else
#include <llvm/Support/IRBuilder.h>
+#endif
namespace rubinius {
class InlinePolicy;
View
5 vm/llvm/jit_compiler.cpp
@@ -14,8 +14,11 @@
#include "objectmemory.hpp"
+#if RBX_LLVM_API_VER >= 302
+#include <llvm/DataLayout.h>
+#else
#include <llvm/Target/TargetData.h>
-// #include <llvm/LinkAllPasses.h>
+#endif
#include <llvm/Analysis/Verifier.h>
#include <llvm/Transforms/Scalar.h>
#include <llvm/CallingConv.h>
View
16 vm/llvm/jit_method.cpp
@@ -248,13 +248,13 @@ namespace jit {
};
Function* func = sig.function("rbx_construct_splat");
- func->setOnlyReadsMemory(true);
- func->setDoesNotThrow(true);
+ func->setOnlyReadsMemory();
+ func->setDoesNotThrow();
CallInst* splat_val = sig.call("rbx_construct_splat", call_args, 4, "splat_val", b());
- splat_val->setOnlyReadsMemory(true);
- splat_val->setDoesNotThrow(true);
+ splat_val->setOnlyReadsMemory();
+ splat_val->setDoesNotThrow();
Value* idx3[] = {
cint(0),
@@ -381,13 +381,13 @@ namespace jit {
};
Function* func = sig.function("rbx_construct_splat");
- func->setOnlyReadsMemory(true);
- func->setDoesNotThrow(true);
+ func->setOnlyReadsMemory();
+ func->setDoesNotThrow();
CallInst* splat_val = sig.call("rbx_construct_splat", call_args, 4, "splat_val", b());
- splat_val->setOnlyReadsMemory(true);
- splat_val->setDoesNotThrow(true);
+ splat_val->setOnlyReadsMemory();
+ splat_val->setDoesNotThrow();
Value* idx3[] = {
cint(0),
View
4 vm/llvm/jit_operations.hpp
@@ -21,7 +21,11 @@
#include <llvm/Value.h>
#include <llvm/BasicBlock.h>
#include <llvm/Function.h>
+#if RBX_LLVM_API_VER >= 302
+#include <llvm/IRBuilder.h>
+#else
#include <llvm/Support/IRBuilder.h>
+#endif
#include <llvm/CallingConv.h>
using namespace llvm;
View
14 vm/llvm/jit_visit.hpp
@@ -2076,8 +2076,8 @@ namespace rubinius {
Function* func = cast<Function>(
module_->getOrInsertFunction("rbx_push_const_fast", ft));
- func->setOnlyReadsMemory(true);
- func->setDoesNotThrow(true);
+ func->setOnlyReadsMemory();
+ func->setDoesNotThrow();
flush();
@@ -2091,8 +2091,8 @@ namespace rubinius {
CallInst* ret = b().CreateCall(func, call_args,
"push_const_fast");
- ret->setOnlyReadsMemory(true);
- ret->setDoesNotThrow(true);
+ ret->setOnlyReadsMemory();
+ ret->setDoesNotThrow();
check_for_exception(ret);
@@ -2806,9 +2806,9 @@ namespace rubinius {
Function* func = cast<Function>(
module_->getOrInsertFunction("rbx_check_interrupts", ft));
- func->setDoesNotCapture(0, true);
- func->setDoesNotCapture(1, true);
- func->setDoesNotCapture(2, true);
+ func->setDoesNotCapture(0);
+ func->setDoesNotCapture(1);
+ func->setDoesNotCapture(2);
flush();
View
10 vm/llvm/state.cpp
@@ -10,8 +10,6 @@
#include "llvm/disassembler.hpp"
#include "llvm/jit_context.hpp"
-#include "vm/config.h"
-
#include "builtin/fixnum.hpp"
#include "builtin/constantscope.hpp"
#include "builtin/module.hpp"
@@ -28,7 +26,11 @@
#include "configuration.hpp"
#include "instruments/timing.hpp"
+#if RBX_LLVM_API_VER >= 302
+#include <llvm/DataLayout.h>
+#else
#include <llvm/Target/TargetData.h>
+#endif
// #include <llvm/LinkAllPasses.h>
#include <llvm/Analysis/Verifier.h>
#include <llvm/Transforms/Scalar.h>
@@ -524,7 +526,11 @@ namespace rubinius {
passes_ = new llvm::FunctionPassManager(module_);
+#if RBX_LLVM_API_VER >= 302
+ passes_->add(new llvm::DataLayout(*engine_->getDataLayout()));
+#else
passes_->add(new llvm::TargetData(*engine_->getTargetData()));
+#endif
if(fast_code_passes) {
add_fast_passes(passes_);
View
8 vm/llvm/state.hpp
@@ -4,12 +4,18 @@
#include <stdint.h>
#include <unistd.h>
+#include "vm/config.h"
+
#include <llvm/Module.h>
#include <llvm/DerivedTypes.h>
#include <llvm/Function.h>
#include <llvm/Module.h>
#include <llvm/Instructions.h>
+#if RBX_LLVM_API_VER >= 302
+#include <llvm/IRBuilder.h>
+#else
#include <llvm/Support/IRBuilder.h>
+#endif
#include <llvm/ExecutionEngine/JIT.h>
#include <llvm/CodeGen/MachineCodeInfo.h>
#include <llvm/Pass.h>
@@ -301,7 +307,7 @@ namespace rubinius {
}
void setDoesNotCapture(const char* name, int which) {
- function(name)->setDoesNotCapture(which, true);
+ function(name)->setDoesNotCapture(which);
}
llvm::CallInst* call(const char* name, llvm::Value** start, int size,
Please sign in to comment.
Something went wrong with that request. Please try again.