[Mesa-dev,v3] clover: Use Legacy PassManager for LLVM trunk (3.7)

Submitted by Shawn Starr on Feb. 14, 2015, 2:16 a.m.

Details

Message ID 1667160.yhLKWQ10hf@segfault
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Shawn Starr Feb. 14, 2015, 2:16 a.m.
v3: Fix my typo, 3rd time's a charm, right?

From 5712d95cb12d8e82d34fafe66bf827ee6726220e Mon Sep 17 00:00:00 2001
From: Shawn Starr <shawn.starr@rogers.com>
Date: Fri, 13 Feb 2015 20:30:01 -0500
Subject: [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)

Signed-off-by: Shawn Starr <shawn.starr@rogers.com>
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 0794e61..3c2ca49 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -44,7 +44,11 @@ 
 #if HAVE_LLVM < 0x0305
 #include <llvm/ADT/OwningPtr.h>
 #endif
+#if HAVE_LLVM >= 0x0307
+#include <llvm/IR/LegacyPassManager.h>
+#else
 #include <llvm/PassManager.h>
+#endif
 #include <llvm/Support/CodeGen.h>
 #include <llvm/Support/TargetSelect.h>
 #include <llvm/Support/MemoryBuffer.h>
@@ -298,7 +302,12 @@  namespace {
    optimize(llvm::Module *mod, unsigned optimization_level,
             const std::vector<llvm::Function *> &kernels) {
 
-      llvm::PassManager PM;
+#if HAVE_LLVM >= 0x0307
+      llvm::legacy::PassManager PM;
+#else
+      llvm::PassManager PM;
+#endif
+
       // Add a function internalizer pass.
       //
       // By default, the function internalizer pass will look for a function

Comments

On Fri, Feb 13, 2015 at 09:16:17PM -0500, Shawn Starr wrote:
> v3: Fix my typo, 3rd time's a charm, right?
> 

Pushed, thanks!

-Tom

> From 5712d95cb12d8e82d34fafe66bf827ee6726220e Mon Sep 17 00:00:00 2001
> From: Shawn Starr <shawn.starr@rogers.com>
> Date: Fri, 13 Feb 2015 20:30:01 -0500
> Subject: [PATCH] clover: Use Legacy PassManager for LLVM trunk (3.7)
> 
> Signed-off-by: Shawn Starr <shawn.starr@rogers.com>
> ---
>  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 0794e61..3c2ca49 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -44,7 +44,11 @@
>  #if HAVE_LLVM < 0x0305
>  #include <llvm/ADT/OwningPtr.h>
>  #endif
> +#if HAVE_LLVM >= 0x0307
> +#include <llvm/IR/LegacyPassManager.h>
> +#else
>  #include <llvm/PassManager.h>
> +#endif
>  #include <llvm/Support/CodeGen.h>
>  #include <llvm/Support/TargetSelect.h>
>  #include <llvm/Support/MemoryBuffer.h>
> @@ -298,7 +302,12 @@ namespace {
>     optimize(llvm::Module *mod, unsigned optimization_level,
>              const std::vector<llvm::Function *> &kernels) {
>  
> -      llvm::PassManager PM;
> +#if HAVE_LLVM >= 0x0307
> +      llvm::legacy::PassManager PM;
> +#else
> +      llvm::PassManager PM;
> +#endif
> +
>        // Add a function internalizer pass.
>        //
>        // By default, the function internalizer pass will look for a function
> -- 
> 2.1.0
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev