From 6613a4a0295879dc3ba2c13198f3ad5de7919487 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 20 Nov 2019 06:51:22 +0000 Subject: [PATCH] swr: Fix build with llvm-10.0. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jan Zielinski --- src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp index 74edd4febbc..87aecb3a4de 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp @@ -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 -- 2.30.2