Skip to content

Commit

Permalink
[BOLT][NFC] Refactor relocation loop (#88424)
Browse files Browse the repository at this point in the history
Use the std `if () continue;` idiom before falling into the
processing.
  • Loading branch information
urnathan authored Apr 12, 2024
1 parent 5752e31 commit 4dd20b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2306,9 +2306,13 @@ void RewriteInstance::processRelocations() {
return;

for (const SectionRef &Section : InputFile->sections()) {
if (cantFail(Section.getRelocatedSection()) != InputFile->section_end() &&
!BinarySection(*BC, Section).isAllocatable())
readRelocations(Section);
section_iterator SecIter = cantFail(Section.getRelocatedSection());
if (SecIter == InputFile->section_end())
continue;
if (BinarySection(*BC, Section).isAllocatable())
continue;

readRelocations(Section);
}

if (NumFailedRelocations)
Expand Down

0 comments on commit 4dd20b0

Please sign in to comment.