[TableGen] Avoid assignmentInAssert warning (#139715)
ExpectedID should be optimized out anyway if built without assertions
because nothing reads its value.
Fixes #90327
diff --git a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
index 36c0cf5..d11812b 100644
--- a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
@@ -2610,9 +2610,9 @@
// That way we can just get the RuleID from the enum by subtracting
// (GICXXPred_Invalid + 1).
unsigned ExpectedID = 0;
- (void)ExpectedID;
for (const auto &ID : keys(AllCombineRules)) {
- assert(ExpectedID++ == ID && "combine rules are not ordered!");
+ ++ExpectedID;
+ assert(ExpectedID == ID && "combine rules are not ordered!");
OS << " " << getIsEnabledPredicateEnumName(ID) << EnumeratorSeparator;
EnumeratorSeparator = ",\n";
}