Skip to content

Commit 3bb728d

Browse files
committed
silencing gcc false positive warning, rebased
1 parent 86e2ad2 commit 3bb728d

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2849,7 +2849,7 @@ void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,
28492849

28502850
if (isElf) {
28512851
MCSymbolELF *LinkedToSym = dyn_cast<MCSymbolELF>(CurrentFnSym);
2852-
int Flags = F.hasComdat() ? ELF::SHF_GROUP : 0;
2852+
int Flags = F.hasComdat() ? (int)ELF::SHF_GROUP : 0;
28532853

28542854
JumpTableSizesSection = OutContext.getELFSection(
28552855
sectionName, ELF::SHT_LLVM_JT_SIZES, Flags, 0, GroupName, F.hasComdat(),

mlir/CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,20 @@ check_c_compiler_flag("-Werror=mismatched-tags" C_SUPPORTS_WERROR_MISMATCHED_TAG
8484
append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_C_FLAGS)
8585
append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_CXX_FLAGS)
8686

87-
# Silence a false positive GCC -Wunused-but-set-parameter warning in constexpr
88-
# cases, by marking SelectedCase as used. See
89-
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827 for details. The issue is
90-
# fixed in GCC 10.
91-
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0")
92-
check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
93-
append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
87+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
88+
# Silence a false positive GCC -Wunused-but-set-parameter warning in
89+
# constexpr cases. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827
90+
# for details
91+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0")
92+
check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
93+
append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
94+
endif()
95+
# Silence a false positive GCC -Wdeprecated-copy warning in cases where
96+
# a copy operator is defined through "using" a base class copy operator.
97+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0")
98+
check_cxx_compiler_flag("-Wno-deprecated-copy" CXX_SUPPORTS_WNO_DEPRECTAED_COPY)
99+
append_if(CXX_SUPPORTS_WNO_DEPRECTAED_COPY "-Wno-deprecated-copy" CMAKE_CXX_FLAGS)
100+
endif()
94101
endif()
95102

96103
# Installing the headers and docs needs to depend on generating any public

mlir/include/mlir/Pass/Pass.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class Pass {
9494
Option(Pass &parent, StringRef arg, Args &&...args)
9595
: detail::PassOptions::Option<DataType, OptionParser>(
9696
parent.passOptions, arg, std::forward<Args>(args)...) {}
97-
Option &operator=(const Option &other) = default; // gcc11 -Wdeprecated-copy
9897
using detail::PassOptions::Option<DataType, OptionParser>::operator=;
9998
};
10099
/// This class represents a specific pass option that contains a list of

0 commit comments

Comments
 (0)