[llvm] 195fe59 - [TableGen] Fix a warning in GlobalISelCombinerEmitter.cpp (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Tue May 13 06:49:34 PDT 2025
Author: Jie Fu
Date: 2025-05-13T21:48:17+08:00
New Revision: 195fe59c11b825548343ba996cf5e26fe2c432f1
URL: https://github.com/llvm/llvm-project/commit/195fe59c11b825548343ba996cf5e26fe2c432f1
DIFF: https://github.com/llvm/llvm-project/commit/195fe59c11b825548343ba996cf5e26fe2c432f1.diff
LOG: [TableGen] Fix a warning in GlobalISelCombinerEmitter.cpp (NFC)
/llvm-project/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp:2612:14:
error: variable 'ExpectedID' set but not used [-Werror,-Wunused-but-set-variable]
unsigned ExpectedID = 0;
^
1 error generated.
Added:
Modified:
llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
index f09598286e548..9fcce0b80838e 100644
--- a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
@@ -2609,7 +2609,7 @@ void GICombinerEmitter::emitTestSimplePredicate(raw_ostream &OS) {
// To avoid emitting a switch, we expect that all those rules are in order.
// That way we can just get the RuleID from the enum by subtracting
// (GICXXPred_Invalid + 1).
- unsigned ExpectedID = 0;
+ [[maybe_unused]] unsigned ExpectedID = 0;
for (const auto &ID : keys(AllCombineRules)) {
assert(ExpectedID == ID && "combine rules are not ordered!");
++ExpectedID;
More information about the llvm-commits
mailing list