[Mesa-dev] [PATCH] swr/rast: Fix WriteBitcodeToFile usage with llvm-7.0.
Kyriazis, George
george.kyriazis at intel.com
Tue May 1 12:34:09 UTC 2018
Reviewed-By: George Kyriazis <george.kyriazis at intel.com<mailto:george.kyriazis at intel.com>>
On May 1, 2018, at 2:05 AM, Vinson Lee <vlee at freedesktop.org<mailto:vlee at freedesktop.org>> wrote:
Fix build error after llvm-7.0svn r325155 ("Pass a reference to a module
to the bitcode writer.").
CXX rasterizer/jitter/libmesaswr_la-JitManager.lo
rasterizer/jitter/JitManager.cpp:548:30: error: reference to type 'const llvm::Module' could not bind to an lvalue of type 'const llvm::Module *'
llvm::WriteBitcodeToFile(M, bitcodeStream);
^
Suggested-by: George Kyriazis <george.kyriazis at intel.com<mailto:george.kyriazis at intel.com>>
Signed-off-by: Vinson Lee <vlee at freedesktop.org<mailto:vlee at freedesktop.org>>
---
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 aadcca25550f..efb747abdee8 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -545,7 +545,11 @@ static inline uint32_t ComputeModuleCRC(const llvm::Module* M)
std::string bitcodeBuffer;
raw_string_ostream bitcodeStream(bitcodeBuffer);
+#if LLVM_VERSION_MAJOR >= 7
+ llvm::WriteBitcodeToFile(*M, bitcodeStream);
+#else
llvm::WriteBitcodeToFile(M, bitcodeStream);
+#endif
//M->print(bitcodeStream, nullptr, false);
bitcodeStream.flush();
--
2.17.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180501/0dd42d50/attachment.html>
More information about the mesa-dev
mailing list