diff options
author | Tom Stellard <[email protected]> | 2012-10-10 20:22:22 +0000 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-10-11 21:32:54 +0000 |
commit | dc54c49df9c9e37b00d3ba20455407999e03f391 (patch) | |
tree | 75b31e9b2cb9c3571a123eaa3103b6049caafb54 /src | |
parent | c6b0132d1e86556cec71f673473052937d738749 (diff) |
clover: Fix build with LLVM 3.2
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 77b02de7e9e..521f998fe58 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -35,10 +35,15 @@ #include <llvm/Support/TargetSelect.h> #include <llvm/Support/MemoryBuffer.h> #include <llvm/Support/PathV1.h> -#include <llvm/Target/TargetData.h> #include <llvm/Transforms/IPO.h> #include <llvm/Transforms/IPO/PassManagerBuilder.h> +#if HAVE_LLVM < 0x0302 +#include <llvm/Target/TargetData.h> +#else +#include <llvm/DataLayout.h> +#endif + #include "pipe/p_state.h" #include "util/u_memory.h" @@ -216,7 +221,11 @@ namespace { E = kernel_func->arg_end(); I != E; ++I) { llvm::Argument &arg = *I; llvm::Type *arg_type = arg.getType(); +#if HAVE_LLVM < 0x0302 llvm::TargetData TD(kernel_func->getParent()); +#else + llvm::DataLayout TD(kernel_func->getParent()->getDataLayout()); +#endif unsigned arg_size = TD.getTypeStoreSize(arg_type); if (llvm::isa<llvm::PointerType>(arg_type) && arg.hasByValAttr()) { |