Skip to content

Commit

Permalink
[Transform][Utils][NFC] Clean up CtorUtils.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-shaposhnikov committed May 11, 2022
1 parent 2ea8f20 commit da82338
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Transforms/Utils/CtorUtils.cpp
Expand Up @@ -127,9 +127,8 @@ bool llvm::optimizeGlobalCtorsList(
bool MadeChange = false;

// Loop over global ctors, optimizing them when we can.
unsigned NumCtors = Ctors.size();
BitVector CtorsToRemove(NumCtors);
for (unsigned i = 0; i != Ctors.size() && NumCtors > 0; ++i) {
BitVector CtorsToRemove(Ctors.size());
for (unsigned i = 0, e = Ctors.size(); i != e; ++i) {
Function *F = Ctors[i];
// Found a null terminator in the middle of the list, prune off the rest of
// the list.
Expand All @@ -146,7 +145,6 @@ bool llvm::optimizeGlobalCtorsList(
if (ShouldRemove(F)) {
Ctors[i] = nullptr;
CtorsToRemove.set(i);
NumCtors--;
MadeChange = true;
continue;
}
Expand Down

0 comments on commit da82338

Please sign in to comment.