Skip to content

[TableGen] Avoid assignmentInAssert warning #139715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2608,9 +2608,9 @@ void GICombinerEmitter::emitTestSimplePredicate(raw_ostream &OS) {
// 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!");
Comment on lines +2612 to +2613
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code used post-increment, so these two lines should be swapped.

OS << " " << getIsEnabledPredicateEnumName(ID) << EnumeratorSeparator;
EnumeratorSeparator = ",\n";
}
Expand Down
Loading