[Mesa-dev] [PATCH] swr/rast: Fix addPassesToEmitFile usage with llvm-7.0.

Vinson Lee vlee at freedesktop.org
Wed May 23 08:08:48 UTC 2018


Fix build error after llvm-7.0svn r332881 ("CodeGen: Add a dwo output
file argument to addPassesToEmitFile and hook it up to dwo output.").

  CXX      rasterizer/jitter/libmesaswr_la-JitManager.lo
rasterizer/jitter/JitManager.cpp:368:93: error: too few arguments to function call, expected at least 4, have 3
        pTarget->addPassesToEmitFile(*pMPasses, filestream, TargetMachine::CGFT_AssemblyFile);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                        ^

Signed-off-by: Vinson Lee <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 e9412b1b53c5..8a5d95d2ea07 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -365,7 +365,11 @@ void JitManager::DumpAsm(Function* pFunction, const char* fileName)
         legacy::PassManager* pMPasses = new legacy::PassManager();
         auto* pTarget = mpExec->getTargetMachine();
         pTarget->Options.MCOptions.AsmVerbose = true;
+#if LLVM_VERSION_MAJOR >= 7
+        pTarget->addPassesToEmitFile(*pMPasses, filestream, nullptr, TargetMachine::CGFT_AssemblyFile);
+#else
         pTarget->addPassesToEmitFile(*pMPasses, filestream, TargetMachine::CGFT_AssemblyFile);
+#endif
         pMPasses->run(*pModule);
         delete pMPasses;
         pTarget->Options.MCOptions.AsmVerbose = false;
-- 
2.17.0.dropbox.4



More information about the mesa-dev mailing list