st/clover: Fix build against LLVM SVN >= r216583
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 28 Aug 2014 03:05:21 +0000 (12:05 +0900)
committerMichel Dänzer <michel@daenzer.net>
Thu, 28 Aug 2014 03:05:21 +0000 (12:05 +0900)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/llvm/invocation.cpp

index d351bc5c3a20211c6436edd75cf215aa8e9c4ca3..7bca0d68357d5cabd38d3e3f3156ccceab1dafbd 100644 (file)
@@ -211,8 +211,13 @@ namespace {
                                  &c.getDiagnosticOpts()));
 #endif
 
+#if HAVE_LLVM >= 0x0306
+      c.getPreprocessorOpts().addRemappedFile(name,
+                                              llvm::MemoryBuffer::getMemBuffer(source).release());
+#else
       c.getPreprocessorOpts().addRemappedFile(name,
                                       llvm::MemoryBuffer::getMemBuffer(source));
+#endif
 
       // Setting this attribute tells clang to link this file before
       // performing any optimizations.  This is required so that