swr: Fix build with llvm-10.0.
authorVinson Lee <vlee@freedesktop.org>
Wed, 20 Nov 2019 06:51:22 +0000 (06:51 +0000)
committerVinson Lee <vlee@freedesktop.org>
Thu, 21 Nov 2019 21:20:08 +0000 (13:20 -0800)
Fix build error after llvm-10.0 commit 1dfede3122ee ("Move
CodeGenFileType enum to Support/CodeGen.h").

../src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp: In member function ‘void JitManager::DumpAsm(llvm::Function*, const char*)’:
../src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp:428:45: error: ‘CGFT_AssemblyFile’ is not a member of ‘llvm::TargetMachine’
             *pMPasses, filestream, nullptr, TargetMachine::CGFT_AssemblyFile);
                                             ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp

index 74edd4febbc5ac51654f473d6b645e5777c29fec..87aecb3a4dea8ad7ced5331d10e4ebb021f75db1 100644 (file)
@@ -423,7 +423,10 @@ 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
+#if LLVM_VERSION_MAJOR >= 10
+        pTarget->addPassesToEmitFile(
+            *pMPasses, filestream, nullptr, CGFT_AssemblyFile);
+#elif LLVM_VERSION_MAJOR >= 7
         pTarget->addPassesToEmitFile(
             *pMPasses, filestream, nullptr, TargetMachine::CGFT_AssemblyFile);
 #else