[Mlir-commits] [mlir] 4a3473f - [mlir] silence unused-function warnings in table-generated code

Alex Zinenko llvmlistbot at llvm.org
Wed Feb 17 10:28:38 PST 2021


Author: Alex Zinenko
Date: 2021-02-17T19:28:31+01:00
New Revision: 4a3473ff3b5c92de16d9571391f417007a9f0f24

URL: https://github.com/llvm/llvm-project/commit/4a3473ff3b5c92de16d9571391f417007a9f0f24
DIFF: https://github.com/llvm/llvm-project/commit/4a3473ff3b5c92de16d9571391f417007a9f0f24.diff

LOG: [mlir] silence unused-function warnings in table-generated code

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96695

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
    mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
index baf7107db80f..5fbb291922f1 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 d52cc78a48fc..73dc16c27559 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


        


More information about the Mlir-commits mailing list