[PATCH] D116914: [lld-macho] Rename LazySymbol to LazyArchive. NFC
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 9 20:55:07 PST 2022
MaskRay created this revision.
MaskRay added a reviewer: lld-macho.
Herald added a project: lld-macho.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
D116913 <https://reviews.llvm.org/D116913> will add LazyObject. Rename LazySymbol to LazyArchive to avoid confusion
and mirror ELF.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116914
Files:
lld/MachO/SymbolTable.cpp
lld/MachO/Symbols.cpp
lld/MachO/Symbols.h
Index: lld/MachO/Symbols.h
===================================================================
--- lld/MachO/Symbols.h
+++ lld/MachO/Symbols.h
@@ -281,9 +281,9 @@
const bool tlv : 1;
};
-class LazySymbol : public Symbol {
+class LazyArchive : public Symbol {
public:
- LazySymbol(ArchiveFile *file, const llvm::object::Archive::Symbol &sym)
+ LazyArchive(ArchiveFile *file, const llvm::object::Archive::Symbol &sym)
: Symbol(LazyKind, sym.getName(), file), sym(sym) {}
ArchiveFile *getFile() const { return cast<ArchiveFile>(file); }
@@ -312,7 +312,7 @@
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)];
alignas(LazyObject) char f[sizeof(LazyObject)];
};
Index: lld/MachO/Symbols.cpp
===================================================================
--- lld/MachO/Symbols.cpp
+++ lld/MachO/Symbols.cpp
@@ -101,4 +101,4 @@
return isInStubs() ? getStubVA() : Symbol::getVA();
}
-void LazySymbol::fetchArchiveMember() { getFile()->fetch(sym); }
+void LazyArchive::fetchArchiveMember() { getFile()->fetch(sym); }
Index: lld/MachO/SymbolTable.cpp
===================================================================
--- lld/MachO/SymbolTable.cpp
+++ lld/MachO/SymbolTable.cpp
@@ -113,7 +113,7 @@
if (wasInserted)
replaceSymbol<Undefined>(s, name, file, refState);
- else if (auto *lazy = dyn_cast<LazySymbol>(s))
+ else if (auto *lazy = dyn_cast<LazyArchive>(s))
lazy->fetchArchiveMember();
else if (isa<LazyObject>(s))
extract(*s->getFile(), s->getName());
@@ -187,7 +187,7 @@
std::tie(s, wasInserted) = insert(name, file);
if (wasInserted) {
- replaceSymbol<LazySymbol>(s, file, sym);
+ replaceSymbol<LazyArchive>(s, file, sym);
} else if (isa<Undefined>(s)) {
file->fetch(sym);
} else if (auto *dysym = dyn_cast<DylibSymbol>(s)) {
@@ -195,7 +195,7 @@
if (dysym->getRefState() != RefState::Unreferenced)
file->fetch(sym);
else
- replaceSymbol<LazySymbol>(s, file, sym);
+ replaceSymbol<LazyArchive>(s, file, sym);
}
}
return s;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116914.398497.patch
Type: text/x-patch
Size: 2268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220110/021b7f3e/attachment.bin>
More information about the llvm-commits
mailing list