Skip to content

Commit 8be514c

Browse files
authored
[TableGen] Avoid assignmentInAssert warning (#139715)
ExpectedID should be optimized out anyway if built without assertions because nothing reads its value. Fixes #90327
1 parent ba2b21a commit 8be514c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,9 +2610,9 @@ void GICombinerEmitter::emitTestSimplePredicate(raw_ostream &OS) {
26102610
// That way we can just get the RuleID from the enum by subtracting
26112611
// (GICXXPred_Invalid + 1).
26122612
unsigned ExpectedID = 0;
2613-
(void)ExpectedID;
26142613
for (const auto &ID : keys(AllCombineRules)) {
2615-
assert(ExpectedID++ == ID && "combine rules are not ordered!");
2614+
++ExpectedID;
2615+
assert(ExpectedID == ID && "combine rules are not ordered!");
26162616
OS << " " << getIsEnabledPredicateEnumName(ID) << EnumeratorSeparator;
26172617
EnumeratorSeparator = ",\n";
26182618
}

0 commit comments

Comments
 (0)