From fb12f35622770b2724aaf4e4747c53a3e71fce54 Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Thu, 12 Dec 2019 17:00:32 +0100 Subject: [PATCH] Fix build for llvm newer than 9.0 (#4515) --- src/codegen/llvm/codegen_amdgpu.cc | 8 ++++---- src/codegen/llvm/codegen_nvptx.cc | 6 +++--- src/codegen/llvm/llvm_module.cc | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/codegen/llvm/codegen_amdgpu.cc b/src/codegen/llvm/codegen_amdgpu.cc index 2b017d1..491a304 100644 --- a/src/codegen/llvm/codegen_amdgpu.cc +++ b/src/codegen/llvm/codegen_amdgpu.cc @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -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::TargetMachine::CGFT_ObjectFile) == 0) + pass, destObj, nullptr, llvm::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::TargetMachine::CGFT_AssemblyFile) == 0) + llvm::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 49b1889..b6bc6ef 100644 --- a/src/codegen/llvm/codegen_nvptx.cc +++ b/src/codegen/llvm/codegen_nvptx.cc @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -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::TargetMachine::CGFT_AssemblyFile) == 0) + pass, dest_ptx, nullptr, llvm::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 c3401c9..d874b46 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::TargetMachine::CGFT_ObjectFile) == 0) + pass, dest, nullptr, llvm::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::TargetMachine::CGFT_AssemblyFile) == 0) + pass, dest, nullptr, llvm::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::TargetMachine::CGFT_AssemblyFile) == 0) + pass, rso, nullptr, llvm::CGFT_AssemblyFile) == 0) << "Cannot emit target CGFT_AssemblyFile"; #endif pass.run(*m); -- 2.7.4