clover: Use Legacy PassManager for LLVM trunk (3.7)
authorShawn Starr <shawn.starr@rogers.com>
Sat, 14 Feb 2015 02:16:17 +0000 (21:16 -0500)
committerTom Stellard <thomas.stellard@amd.com>
Sat, 14 Feb 2015 01:31:57 +0000 (01:31 +0000)
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Shawn Starr <shawn.starr@rogers.com>
src/gallium/state_trackers/clover/llvm/invocation.cpp

index 0794e6156de4f874b33ed3f85dc40a459fec85ff..508979a0225ace40fa6acc0feff7332343fce0cf 100644 (file)
 #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) {
 
+#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