Skip to content

Commit da82338

Browse files
[Transform][Utils][NFC] Clean up CtorUtils.cpp
1 parent 2ea8f20 commit da82338

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Utils/CtorUtils.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,8 @@ bool llvm::optimizeGlobalCtorsList(
127127
bool MadeChange = false;
128128

129129
// Loop over global ctors, optimizing them when we can.
130-
unsigned NumCtors = Ctors.size();
131-
BitVector CtorsToRemove(NumCtors);
132-
for (unsigned i = 0; i != Ctors.size() && NumCtors > 0; ++i) {
130+
BitVector CtorsToRemove(Ctors.size());
131+
for (unsigned i = 0, e = Ctors.size(); i != e; ++i) {
133132
Function *F = Ctors[i];
134133
// Found a null terminator in the middle of the list, prune off the rest of
135134
// the list.
@@ -146,7 +145,6 @@ bool llvm::optimizeGlobalCtorsList(
146145
if (ShouldRemove(F)) {
147146
Ctors[i] = nullptr;
148147
CtorsToRemove.set(i);
149-
NumCtors--;
150148
MadeChange = true;
151149
continue;
152150
}

0 commit comments

Comments
 (0)