[llvm] 9b1d96b - [GISel] Fix -Wunused-function in release builds (#217786)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 20 16:57:22 PDT 2026
Author: Aiden Grossman
Date: 2026-08-20T23:57:17Z
New Revision: 9b1d96b780570a466126784421b37dd17cf87efe
URL: https://github.com/llvm/llvm-project/commit/9b1d96b780570a466126784421b37dd17cf87efe
DIFF: https://github.com/llvm/llvm-project/commit/9b1d96b780570a466126784421b37dd17cf87efe.diff
LOG: [GISel] Fix -Wunused-function in release builds (#217786)
This operator is only used in DEBUG builds. Exposed by
732d8413c69b57a10de1beb1964a57a9264b23b9 which moved the Impl class into
an anonymous namespace in the source file which allowed the compiler to
reason about usage.
Fixes https://lab.llvm.org/buildbot/#/builders/228/builds/8620
Added:
Modified:
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
index 9405a6dbf0938..ebeaa97f48757 100644
--- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -485,7 +485,8 @@ class RegBankSelectImpl {
LLVM_ABI void print(raw_ostream &OS) const;
/// Overload the stream operator for easy debug printing.
- friend raw_ostream &operator<<(raw_ostream &OS, const MappingCost &Cost) {
+ [[maybe_unused]] friend raw_ostream &operator<<(raw_ostream &OS,
+ const MappingCost &Cost) {
Cost.print(OS);
return OS;
}
More information about the llvm-commits
mailing list