diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp index c596b8c1ff3290..74bd463706c2e7 100644 --- a/lld/MachO/InputFiles.cpp +++ b/lld/MachO/InputFiles.cpp @@ -1426,7 +1426,7 @@ ArchiveFile::ArchiveFile(std::unique_ptr &&f) void ArchiveFile::addLazySymbols() { for (const object::Archive::Symbol &sym : file->symbols()) - symtab->addLazy(sym.getName(), this, sym); + symtab->addLazyArchive(sym.getName(), this, sym); } static Expected loadArchiveMember(MemoryBufferRef mb, diff --git a/lld/MachO/SymbolTable.cpp b/lld/MachO/SymbolTable.cpp index 794ccb91d5b63b..ffae1127e743d1 100644 --- a/lld/MachO/SymbolTable.cpp +++ b/lld/MachO/SymbolTable.cpp @@ -113,7 +113,7 @@ Symbol *SymbolTable::addUndefined(StringRef name, InputFile *file, if (wasInserted) replaceSymbol(s, name, file, refState); - else if (auto *lazy = dyn_cast(s)) + else if (auto *lazy = dyn_cast(s)) lazy->fetchArchiveMember(); else if (auto *dynsym = dyn_cast(s)) dynsym->reference(refState); @@ -178,14 +178,14 @@ Symbol *SymbolTable::addDynamicLookup(StringRef name) { return addDylib(name, /*file=*/nullptr, /*isWeakDef=*/false, /*isTlv=*/false); } -Symbol *SymbolTable::addLazy(StringRef name, ArchiveFile *file, - const object::Archive::Symbol &sym) { +Symbol *SymbolTable::addLazyArchive(StringRef name, ArchiveFile *file, + const object::Archive::Symbol &sym) { Symbol *s; bool wasInserted; std::tie(s, wasInserted) = insert(name, file); if (wasInserted) { - replaceSymbol(s, file, sym); + replaceSymbol(s, file, sym); } else if (isa(s)) { file->fetch(sym); } else if (auto *dysym = dyn_cast(s)) { @@ -193,7 +193,7 @@ Symbol *SymbolTable::addLazy(StringRef name, ArchiveFile *file, if (dysym->getRefState() != RefState::Unreferenced) file->fetch(sym); else - replaceSymbol(s, file, sym); + replaceSymbol(s, file, sym); } } return s; diff --git a/lld/MachO/SymbolTable.h b/lld/MachO/SymbolTable.h index 67923b07538acb..2a5f723c97478a 100644 --- a/lld/MachO/SymbolTable.h +++ b/lld/MachO/SymbolTable.h @@ -51,8 +51,8 @@ class SymbolTable { Symbol *addDylib(StringRef name, DylibFile *file, bool isWeakDef, bool isTlv); Symbol *addDynamicLookup(StringRef name); - Symbol *addLazy(StringRef name, ArchiveFile *file, - const llvm::object::Archive::Symbol &sym); + Symbol *addLazyArchive(StringRef name, ArchiveFile *file, + const llvm::object::Archive::Symbol &sym); Defined *addSynthetic(StringRef name, InputSection *, uint64_t value, bool isPrivateExtern, bool includeInSymtab, diff --git a/lld/MachO/Symbols.cpp b/lld/MachO/Symbols.cpp index b0ebd224affbdb..7bf8c6dd56d632 100644 --- a/lld/MachO/Symbols.cpp +++ b/lld/MachO/Symbols.cpp @@ -101,4 +101,4 @@ uint64_t DylibSymbol::getVA() const { return isInStubs() ? getStubVA() : Symbol::getVA(); } -void LazySymbol::fetchArchiveMember() { getFile()->fetch(sym); } +void LazyArchive::fetchArchiveMember() { getFile()->fetch(sym); } diff --git a/lld/MachO/Symbols.h b/lld/MachO/Symbols.h index d1182a0a2d326d..ae369a6bc4d3c6 100644 --- a/lld/MachO/Symbols.h +++ b/lld/MachO/Symbols.h @@ -37,7 +37,7 @@ class Symbol { UndefinedKind, CommonKind, DylibKind, - LazyKind, + LazyArchiveKind, }; virtual ~Symbol() {} @@ -280,15 +280,15 @@ class DylibSymbol : public Symbol { const bool tlv : 1; }; -class LazySymbol : public Symbol { +class LazyArchive : public Symbol { public: - LazySymbol(ArchiveFile *file, const llvm::object::Archive::Symbol &sym) - : Symbol(LazyKind, sym.getName(), file), sym(sym) {} + LazyArchive(ArchiveFile *file, const llvm::object::Archive::Symbol &sym) + : Symbol(LazyArchiveKind, sym.getName(), file), sym(sym) {} ArchiveFile *getFile() const { return cast(file); } void fetchArchiveMember(); - static bool classof(const Symbol *s) { return s->kind() == LazyKind; } + static bool classof(const Symbol *s) { return s->kind() == LazyArchiveKind; } private: const llvm::object::Archive::Symbol sym; @@ -299,7 +299,7 @@ union SymbolUnion { alignas(Undefined) char b[sizeof(Undefined)]; alignas(CommonSymbol) char c[sizeof(CommonSymbol)]; alignas(DylibSymbol) char d[sizeof(DylibSymbol)]; - alignas(LazySymbol) char e[sizeof(LazySymbol)]; + alignas(LazyArchive) char e[sizeof(LazyArchive)]; }; template diff --git a/lld/MachO/UnwindInfoSection.cpp b/lld/MachO/UnwindInfoSection.cpp index d28c7a33ff36d1..c4baf93e285c3b 100644 --- a/lld/MachO/UnwindInfoSection.cpp +++ b/lld/MachO/UnwindInfoSection.cpp @@ -226,7 +226,7 @@ void UnwindInfoSectionImpl::prepareRelocations(ConcatInputSection *isec) { // (See discussions/alternatives already considered on D107533) if (!defined->isExternal()) if (Symbol *sym = symtab->find(defined->getName())) - if (sym->kind() != Symbol::LazyKind) + if (sym->kind() != Symbol::LazyArchiveKind) r.referent = s = sym; } if (auto *undefined = dyn_cast(s)) {