From: Alex Zinenko Date: Mon, 15 Feb 2021 09:52:19 +0000 (+0100) Subject: [mlir] silence unused-function warnings in table-generated code X-Git-Tag: llvmorg-14-init~14856 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a3473ff3b5c92de16d9571391f417007a9f0f24;p=platform%2Fupstream%2Fllvm.git [mlir] silence unused-function warnings in table-generated code Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D96695 --- diff --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp index baf7107..5fbb291 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp @@ -26,6 +26,11 @@ using namespace mlir; using namespace mlir::LLVM; using mlir::LLVM::detail::getLLVMConstant; +// The include below has a static function unused in this translation unit, +// declare it as such to silence a warning. +static LLVM_ATTRIBUTE_UNUSED ::llvm::GlobalValue::LinkageTypes +convertLinkageToLLVM(::mlir::LLVM::Linkage value); + #include "mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc" /// Convert MLIR integer comparison predicate to LLVM IR comparison predicate. diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp index d52cc78..73dc16c 100644 --- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp @@ -46,6 +46,11 @@ using namespace mlir; using namespace mlir::LLVM; using namespace mlir::LLVM::detail; +// The include below has a static function unused in this translation unit, +// declare it as such to silence a warning. +static LLVM_ATTRIBUTE_UNUSED ::llvm::InlineAsm::AsmDialect +convertAsmDialectToLLVM(::mlir::LLVM::AsmDialect value); + #include "mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc" /// Builds a constant of a sequential LLVM type `type`, potentially containing