Mesa (master): swr/rast: fix MemoryBuffer build break for llvm-6

Tim Rowley torowley at kemper.freedesktop.org
Wed Jan 3 17:42:43 UTC 2018


Module: Mesa
Branch: master
Commit: ad218754c79e0af61d5ba225a4b195cb55c2cac9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad218754c79e0af61d5ba225a4b195cb55c2cac9

Author: Tim Rowley <timothy.o.rowley at intel.com>
Date:   Tue Jan  2 10:48:21 2018 -0600

swr/rast: fix MemoryBuffer build break for llvm-6

LLVM api change.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104381
Tested-by: Laurent Carlier <lordheavym at gmail.com>
Reviewed-By: Bruce Cherniak <bruce.cherniak at intel.com>

---

 src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 3f0772c942..59672bb545 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -498,7 +498,11 @@ std::unique_ptr<llvm::MemoryBuffer> JitCache::getObject(const llvm::Module* M)
             break;
         }
 
+#if LLVM_VERSION_MAJOR < 6
         pBuf = llvm::MemoryBuffer::getNewUninitMemBuffer(size_t(header.GetBufferSize()));
+#else
+        pBuf = llvm::WritableMemoryBuffer::getNewUninitMemBuffer(size_t(header.GetBufferSize()));
+#endif
         if (!fread(const_cast<char*>(pBuf->getBufferStart()), header.GetBufferSize(), 1, fpIn))
         {
             pBuf = nullptr;




More information about the mesa-commit mailing list