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

Aaron Watry awatry at gmail.com
Fri Jun 28 07:41:45 PDT 2013


PathV1.h has been removed. In theory this can go back before llvm 3.4, but I
haven't done the research to find out how far back.

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 362f02f..ee0249d 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -43,7 +43,12 @@
 #include <llvm/PassManager.h>
 #include <llvm/Support/TargetSelect.h>
 #include <llvm/Support/MemoryBuffer.h>
+#if HAVE_LLVM < 0x0304
 #include <llvm/Support/PathV1.h>
+#else
+#include <llvm/ADT/SmallString.h>
+#include <llvm/Support/Path.h>
+#endif
 #include <llvm/Transforms/IPO.h>
 #include <llvm/Transforms/IPO/PassManagerBuilder.h>
 
@@ -222,9 +227,16 @@ namespace {
 
       llvm::PassManager PM;
       llvm::PassManagerBuilder Builder;
+#if HAVE_LLVM < 0x0304
       llvm::sys::Path libclc_path =
                             llvm::sys::Path(LIBCLC_LIBEXECDIR + processor +
 			                    "-" + triple + ".bc");
+#else
+      llvm::SmallString<1> libclc_path;
+      libclc_path = LIBCLC_LIBEXECDIR;
+      std::string file_name = processor + "-" + triple + ".bc";
+      llvm::sys::path::append(libclc_path, file_name);
+#endif
 
       // Link the kernel with libclc
 #if HAVE_LLVM < 0x0303
-- 
1.8.1.2



More information about the mesa-dev mailing list