From: Tom Stellard Date: Wed, 10 Oct 2012 20:22:22 +0000 (+0000) Subject: clover: Fix build with LLVM 3.2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc54c49df9c9e37b00d3ba20455407999e03f391;p=mesa.git clover: Fix build with LLVM 3.2 Reviewed-by: Francisco Jerez --- 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 #include #include -#include #include #include +#if HAVE_LLVM < 0x0302 +#include +#else +#include +#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(arg_type) && arg.hasByValAttr()) {