Skip to content

Commit

Permalink
[lld-macho] Rename {StubHelper,ObjCStubs}Section::setup() to setUp (NFC)
Browse files Browse the repository at this point in the history
The phrasal verb is spelled "set up"; "setup" is a noun.

Suggested in https://reviews.llvm.org/D132947#inline-1280089
  • Loading branch information
BertalanD committed Aug 30, 2022
1 parent 3d5ea53 commit ae5d542
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lld/MachO/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ static void referenceStubBinder() {
// dyld_stub_binder is in libSystem.dylib, which is usually linked in. This
// isn't needed for correctness, but the presence of that symbol suppresses
// "no symbols" diagnostics from `nm`.
// StubHelperSection::setup() adds a reference and errors out if
// StubHelperSection::setUp() adds a reference and errors out if
// dyld_stub_binder doesn't exist in case it is actually needed.
symtab->addUndefined("dyld_stub_binder", /*file=*/nullptr, /*isWeak=*/false);
}
Expand Down
4 changes: 2 additions & 2 deletions lld/MachO/SyntheticSections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ void StubHelperSection::writeTo(uint8_t *buf) const {
}
}

void StubHelperSection::setup() {
void StubHelperSection::setUp() {
Symbol *binder = symtab->addUndefined("dyld_stub_binder", /*file=*/nullptr,
/*isWeakRef=*/false);
if (auto *undefined = dyn_cast<Undefined>(binder))
Expand Down Expand Up @@ -769,7 +769,7 @@ void ObjCStubsSection::addEntry(Symbol *sym) {
symbols.push_back(newSym);
}

void ObjCStubsSection::setup() {
void ObjCStubsSection::setUp() {
Symbol *objcMsgSend = symtab->addUndefined("_objc_msgSend", /*file=*/nullptr,
/*isWeakRef=*/false);
objcMsgSend->used = true;
Expand Down
4 changes: 2 additions & 2 deletions lld/MachO/SyntheticSections.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class StubHelperSection final : public SyntheticSection {
bool isNeeded() const override;
void writeTo(uint8_t *buf) const override;

void setup();
void setUp();

DylibSymbol *stubBinder = nullptr;
Defined *dyldPrivate = nullptr;
Expand All @@ -324,7 +324,7 @@ class ObjCStubsSection final : public SyntheticSection {
bool isNeeded() const override { return !symbols.empty(); }
void finalize() override { isec->isFinal = true; }
void writeTo(uint8_t *buf) const override;
void setup();
void setUp();

static constexpr llvm::StringLiteral symbolPrefix = "_objc_msgSend$";

Expand Down
4 changes: 2 additions & 2 deletions lld/MachO/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ template <class LP> void Writer::run() {
// InputSections, we should have `isec->canonical() == isec`.
scanSymbols();
if (in.objcStubs->isNeeded())
in.objcStubs->setup();
in.objcStubs->setUp();
scanRelocations();

// Do not proceed if there was an undefined symbol.
Expand All @@ -1148,7 +1148,7 @@ template <class LP> void Writer::run() {
return;

if (in.stubHelper->isNeeded())
in.stubHelper->setup();
in.stubHelper->setUp();

if (in.objCImageInfo->isNeeded())
in.objCImageInfo->finalizeContents();
Expand Down

0 comments on commit ae5d542

Please sign in to comment.