[Mesa-dev] [PATCH] clover: Fix build with LLVM 3.2

Francisco Jerez currojerez at riseup.net
Thu Oct 11 02:34:26 PDT 2012


Tom Stellard <tom at stellard.net> writes:

> From: Tom Stellard <thomas.stellard at amd.com>
>
Looks good to me...

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 77b02de..521f998 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()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121011/9a1b8bda/attachment.pgp>


More information about the mesa-dev mailing list