[Mesa-dev] [PATCH] clover: Fix build error with LLVM 3.4.

Tom Stellard tom at stellard.net
Tue Oct 21 06:30:26 PDT 2014


On Sun, Oct 19, 2014 at 12:27:26AM -0700, Vinson Lee wrote:
> DataLayoutPass was added in LLVM 3.5 r202168, commit
> 57edc9d4ff1648568a5dd7e9958649065b260dca "Make DataLayout a plain
> object, not a pass.".
> 
> This patch fixes this build error with LLVM 3.4.
> 
>   CXX      llvm/libclllvm_la-invocation.lo
> llvm/invocation.cpp: In function 'void {anonymous}::optimize(llvm::Module*, unsigned int, const std::vector<llvm::Function*>&)':
> llvm/invocation.cpp:324:18: error: expected type-specifier
>        PM.add(new llvm::DataLayoutPass(mod));
>                   ^

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85189
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 3cdf883..db3c840 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -320,7 +320,9 @@ namespace {
>           llvm::Function *kernel = *I;
>           export_list.push_back(kernel->getName().data());
>        }
> -#if HAVE_LLVM < 0x0306
> +#if HAVE_LLVM < 0x0305
> +      PM.add(new llvm::DataLayout(mod));
> +#elif HAVE_LLVM < 0x0306
>        PM.add(new llvm::DataLayoutPass(mod));
>  #else
>        PM.add(new llvm::DataLayoutPass());
> -- 
> 2.1.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list