summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Steckelmacher <steckdenis@yahoo.fr>2011-07-23 11:11:27 +0200
committerDenis Steckelmacher <steckdenis@yahoo.fr>2011-07-23 11:11:27 +0200
commit7f2a3b7bef4ca0058b21dd4c157fdec4d98a0a03 (patch)
tree0450fabd8969178131fdfcc431a8207a7488ad2c
parent94cec8b35cbf72f0314ad2ea29a08d4a31b1c927 (diff)
Make Clover compile with latest LLVM
-rw-r--r--src/core/cpu/kernel.cpp7
-rw-r--r--src/core/kernel.cpp12
2 files changed, 9 insertions, 10 deletions
diff --git a/src/core/cpu/kernel.cpp b/src/core/cpu/kernel.cpp
index a019f2f..c8e58d2 100644
--- a/src/core/cpu/kernel.cpp
+++ b/src/core/cpu/kernel.cpp
@@ -49,7 +49,7 @@ bool incVec(cl_ulong dims, T *vec, T *maxs)
}
static llvm::Constant *getPointerConstant(llvm::LLVMContext &C,
- const llvm::Type *type,
+ llvm::Type *type,
void *const *value)
{
llvm::Constant *rs = 0;
@@ -174,7 +174,7 @@ llvm::Function *CPUKernel::callFunction(std::vector<void *> &freeLocal)
// Create a LLVM function that calls the kernels with its arguments
// Code inspired from llvm/lib/ExecutionEngine/JIT/JIT.cpp
// Copyright The LLVM Compiler Infrastructure
- const llvm::FunctionType *k_func_type = p_function->getFunctionType();
+ llvm::FunctionType *k_func_type = p_function->getFunctionType();
llvm::FunctionType *f_type =
llvm::FunctionType::get(p_function->getReturnType(), false);
llvm::Function *stub = llvm::Function::Create(f_type,
@@ -310,8 +310,7 @@ llvm::Function *CPUKernel::callFunction(std::vector<void *> &freeLocal)
}
// Create the call instruction
- llvm::CallInst *call_inst = llvm::CallInst::Create(p_function, args.begin(),
- args.end(), "", block);
+ llvm::CallInst *call_inst = llvm::CallInst::Create(p_function, args, "", block);
call_inst->setCallingConv(p_function->getCallingConv());
call_inst->setTailCall();
diff --git a/src/core/kernel.cpp b/src/core/kernel.cpp
index 3356e21..22fefb6 100644
--- a/src/core/kernel.cpp
+++ b/src/core/kernel.cpp
@@ -80,7 +80,7 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
// Build the arg list of the kernel (or verify it if a previous function
// was already registered)
- const llvm::FunctionType *f = function->getFunctionType();
+ llvm::FunctionType *f = function->getFunctionType();
bool append = (p_args.size() == 0);
if (!append && p_args.size() != f->getNumParams())
@@ -88,7 +88,7 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
for (int i=0; i<f->getNumParams(); ++i)
{
- const llvm::Type *arg_type = f->getParamType(i);
+ llvm::Type *arg_type = f->getParamType(i);
Arg::Kind kind = Arg::Invalid;
Arg::File file = Arg::Private;
unsigned short vec_dim = 1;
@@ -96,7 +96,7 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
if (arg_type->isPointerTy())
{
// It's a pointer, dereference it
- const llvm::PointerType *p_type = llvm::cast<llvm::PointerType>(arg_type);
+ llvm::PointerType *p_type = llvm::cast<llvm::PointerType>(arg_type);
file = (Arg::File)p_type->getAddressSpace();
arg_type = p_type->getElementType();
@@ -110,7 +110,7 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
// If it's a struct, get its name
if (arg_type->isStructTy())
{
- const llvm::StructType *struct_type =
+ llvm::StructType *struct_type =
llvm::cast<llvm::StructType>(arg_type);
llvm::StringRef struct_name = struct_type->getName();
@@ -136,7 +136,7 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
if (arg_type->isVectorTy())
{
// It's a vector, we need its element's type
- const llvm::VectorType *v_type = llvm::cast<llvm::VectorType>(arg_type);
+ llvm::VectorType *v_type = llvm::cast<llvm::VectorType>(arg_type);
vec_dim = v_type->getNumElements();
arg_type = v_type->getElementType();
@@ -153,7 +153,7 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
}
else if (arg_type->isIntegerTy())
{
- const llvm::IntegerType *i_type = llvm::cast<llvm::IntegerType>(arg_type);
+ llvm::IntegerType *i_type = llvm::cast<llvm::IntegerType>(arg_type);
if (i_type->getBitWidth() == 8)
{