Skip to content

Commit b066a6a

Browse files
committed
Address review comments
* Invert condition to allow early continue. * Remove used once variable.
1 parent 29a57db commit b066a6a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

lld/ELF/Relocations.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,18 +2302,17 @@ bool ThunkCreator::normalizeExistingThunk(Relocation &rel, uint64_t src) {
23022302
bool ThunkCreator::addSyntheticLandingPads() {
23032303
bool addressesChanged = false;
23042304
for (Thunk *t : allThunks) {
2305-
if (t->needsSyntheticLandingPad()) {
2306-
Thunk *lpt;
2307-
bool isNew;
2308-
auto &dr = cast<Defined>(t->destination);
2309-
std::tie(lpt, isNew) = getSyntheticLandingPad(dr, t->addend);
2310-
if (isNew) {
2311-
addressesChanged = true;
2312-
ThunkSection *ts = getISThunkSec(cast<InputSection>(dr.section));
2313-
ts->addThunk(lpt);
2314-
}
2315-
t->landingPad = lpt->getThunkTargetSym();
2305+
if (!t->needsSyntheticLandingPad())
2306+
continue;
2307+
Thunk *lpt;
2308+
bool isNew;
2309+
auto &dr = cast<Defined>(t->destination);
2310+
std::tie(lpt, isNew) = getSyntheticLandingPad(dr, t->addend);
2311+
if (isNew) {
2312+
addressesChanged = true;
2313+
getISThunkSec(cast<InputSection>(dr.section))->addThunk(lpt);
23162314
}
2315+
t->landingPad = lpt->getThunkTargetSym();
23172316
}
23182317
return addressesChanged;
23192318
}

0 commit comments

Comments
 (0)