Skip to content

Commit 0044856

Browse files
authored
Revert "llvm/lib/CodeGen/TargetSchedule.cpp:132:12: warning: Assert statement modifies 'NIter'" (#91079)
Reverts #90982 NIter was only declared in !NDEBUG, and only used for assertions - so it was correct that it was incremented inside the assertion. (& in fact now the non-asserts build fails, because the variable is incremented even though it isn't declared)
1 parent 18d1df4 commit 0044856

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/CodeGen/TargetSchedule.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ resolveSchedClass(const MachineInstr *MI) const {
129129
unsigned NIter = 0;
130130
#endif
131131
while (SCDesc->isVariant()) {
132-
++NIter;
133-
assert(NIter < 6 && "Variants are nested deeper than the magic number");
132+
assert(++NIter < 6 && "Variants are nested deeper than the magic number");
134133

135134
SchedClass = STI->resolveSchedClass(SchedClass, MI, this);
136135
SCDesc = SchedModel.getSchedClassDesc(SchedClass);

0 commit comments

Comments
 (0)