From 645431b94c6994946e564ec5647e309fcb1ca2e4 Mon Sep 17 00:00:00 2001 From: Yuanqiang Liu Date: Mon, 9 Dec 2019 03:56:40 +0800 Subject: [PATCH] [Codegen] fix bug on LLVM 10.0 (#4480) --- src/codegen/llvm/codegen_amdgpu.cc | 4 ++-- src/codegen/llvm/codegen_nvptx.cc | 2 +- src/codegen/llvm/llvm_module.cc | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/codegen/llvm/codegen_amdgpu.cc b/src/codegen/llvm/codegen_amdgpu.cc index 799f7aa56f5c..2b017d15f3f1 100644 --- a/src/codegen/llvm/codegen_amdgpu.cc +++ b/src/codegen/llvm/codegen_amdgpu.cc @@ -276,7 +276,7 @@ runtime::Module BuildAMDGPU(Array funcs, std::string target) { << "Cannot emit target CGFT_ObjectFile"; #else CHECK(tm->addPassesToEmitFile( - pass, destObj, nullptr, llvm::CGFT_ObjectFile) == 0) + pass, destObj, nullptr, llvm::TargetMachine::CGFT_ObjectFile) == 0) << "Cannot emit target CGFT_ObjectFile"; #endif pass.run(*mObj); @@ -293,7 +293,7 @@ runtime::Module BuildAMDGPU(Array funcs, std::string target) { << "Cannot emit target CGFT_AssemblyFile"; #else CHECK(tm->addPassesToEmitFile(passAsm, destAsm, nullptr, - llvm::CGFT_AssemblyFile) == 0) + llvm::TargetMachine::CGFT_AssemblyFile) == 0) << "Cannot emit target CGFT_AssemblyFile"; #endif passAsm.run(*mAsm); diff --git a/src/codegen/llvm/codegen_nvptx.cc b/src/codegen/llvm/codegen_nvptx.cc index 51893d277c85..49b18890409c 100644 --- a/src/codegen/llvm/codegen_nvptx.cc +++ b/src/codegen/llvm/codegen_nvptx.cc @@ -245,7 +245,7 @@ runtime::Module BuildNVPTX(Array funcs, std::string target) { << "Cannot emit target CGFT_ObjectFile"; #else CHECK(tm->addPassesToEmitFile( - pass, dest_ptx, nullptr, llvm::CGFT_AssemblyFile) == 0) + pass, dest_ptx, nullptr, llvm::TargetMachine::CGFT_AssemblyFile) == 0) << "Cannot emit target CGFT_ObjectFile"; #endif pass.run(*module); diff --git a/src/codegen/llvm/llvm_module.cc b/src/codegen/llvm/llvm_module.cc index 580dd0403b33..b2ad4c2a4990 100644 --- a/src/codegen/llvm/llvm_module.cc +++ b/src/codegen/llvm/llvm_module.cc @@ -97,7 +97,7 @@ class LLVMModuleNode final : public runtime::ModuleNode { << "Cannot emit target CGFT_ObjectFile"; #else CHECK(tm_->addPassesToEmitFile( - pass, dest, nullptr, llvm::CGFT_ObjectFile) == 0) + pass, dest, nullptr, llvm::TargetMachine::CGFT_ObjectFile) == 0) << "Cannot emit target CGFT_ObjectFile"; #endif pass.run(*m); @@ -119,7 +119,7 @@ class LLVMModuleNode final : public runtime::ModuleNode { << "Cannot emit target CGFT_AssemblyFile"; #else CHECK(tm_->addPassesToEmitFile( - pass, dest, nullptr, llvm::CGFT_AssemblyFile) == 0) + pass, dest, nullptr, llvm::TargetMachine::CGFT_AssemblyFile) == 0) << "Cannot emit target CGFT_AssemblyFile"; #endif pass.run(*m); @@ -166,7 +166,7 @@ class LLVMModuleNode final : public runtime::ModuleNode { << "Cannot emit target CGFT_AssemblyFile"; #else CHECK(tm_->addPassesToEmitFile( - pass, rso, nullptr, llvm::CGFT_AssemblyFile) == 0) + pass, rso, nullptr, llvm::TargetMachine::CGFT_AssemblyFile) == 0) << "Cannot emit target CGFT_AssemblyFile"; #endif pass.run(*m);