[lld] [lld][WebAssembly] Rename fetch() to extract() to match ELF linker. NFC (PR #78625)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 13:09:54 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Sam Clegg (sbc100)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/78625.diff
4 Files Affected:
- (modified) lld/wasm/Driver.cpp (+3-3)
- (modified) lld/wasm/SymbolTable.cpp (+5-5)
- (modified) lld/wasm/Symbols.cpp (+3-1)
- (modified) lld/wasm/Symbols.h (+1-1)
``````````diff
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index a354260c605258..60c6e5c6d5d318 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -705,7 +705,7 @@ static Symbol *handleUndefined(StringRef name, const char *option) {
sym->isUsedInRegularObj = true;
if (auto *lazySym = dyn_cast<LazySymbol>(sym)) {
- lazySym->fetch();
+ lazySym->extract();
if (!config->whyExtract.empty())
config->whyExtractRecords.emplace_back(option, sym->getFile(), *sym);
}
@@ -724,7 +724,7 @@ static void handleLibcall(StringRef name) {
if (!config->whyExtract.empty())
config->whyExtractRecords.emplace_back("<libcall>", sym->getFile(),
*sym);
- lazySym->fetch();
+ lazySym->extract();
}
}
}
@@ -965,7 +965,7 @@ static void processStubLibraries() {
needed->forceExport = true;
if (auto *lazy = dyn_cast<LazySymbol>(needed)) {
depsAdded = true;
- lazy->fetch();
+ lazy->extract();
if (!config->whyExtract.empty())
config->whyExtractRecords.emplace_back(stub_file->getName(),
sym->getFile(), *sym);
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index b5c138cd76392d..1563e667297220 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -533,7 +533,7 @@ Symbol *SymbolTable::addUndefinedFunction(StringRef name,
lazy->setWeak();
lazy->signature = sig;
} else {
- lazy->fetch();
+ lazy->extract();
if (!config->whyExtract.empty())
config->whyExtractRecords.emplace_back(toString(file), s->getFile(),
*s);
@@ -586,7 +586,7 @@ Symbol *SymbolTable::addUndefinedData(StringRef name, uint32_t flags,
if ((flags & WASM_SYMBOL_BINDING_MASK) == WASM_SYMBOL_BINDING_WEAK)
lazy->setWeak();
else
- lazy->fetch();
+ lazy->extract();
} else if (s->isDefined()) {
checkDataType(s, file);
} else if (s->isWeak()) {
@@ -613,7 +613,7 @@ Symbol *SymbolTable::addUndefinedGlobal(StringRef name,
replaceSymbol<UndefinedGlobal>(s, name, importName, importModule, flags,
file, type);
else if (auto *lazy = dyn_cast<LazySymbol>(s))
- lazy->fetch();
+ lazy->extract();
else if (s->isDefined())
checkGlobalType(s, file, type);
else if (s->isWeak())
@@ -639,7 +639,7 @@ Symbol *SymbolTable::addUndefinedTable(StringRef name,
replaceSymbol<UndefinedTable>(s, name, importName, importModule, flags,
file, type);
else if (auto *lazy = dyn_cast<LazySymbol>(s))
- lazy->fetch();
+ lazy->extract();
else if (s->isDefined())
checkTableType(s, file, type);
else if (s->isWeak())
@@ -665,7 +665,7 @@ Symbol *SymbolTable::addUndefinedTag(StringRef name,
replaceSymbol<UndefinedTag>(s, name, importName, importModule, flags, file,
sig);
else if (auto *lazy = dyn_cast<LazySymbol>(s))
- lazy->fetch();
+ lazy->extract();
else if (s->isDefined())
checkTagType(s, file, sig);
else if (s->isWeak())
diff --git a/lld/wasm/Symbols.cpp b/lld/wasm/Symbols.cpp
index 2adf72b6965ca8..47d8d09ab1bd42 100644
--- a/lld/wasm/Symbols.cpp
+++ b/lld/wasm/Symbols.cpp
@@ -425,7 +425,9 @@ const OutputSectionSymbol *SectionSymbol::getOutputSectionSymbol() const {
return section->outputSec->sectionSym;
}
-void LazySymbol::fetch() { cast<ArchiveFile>(file)->addMember(&archiveSymbol); }
+void LazySymbol::extract() {
+ cast<ArchiveFile>(file)->addMember(&archiveSymbol);
+}
void LazySymbol::setWeak() {
flags |= (flags & ~WASM_SYMBOL_BINDING_MASK) | WASM_SYMBOL_BINDING_WEAK;
diff --git a/lld/wasm/Symbols.h b/lld/wasm/Symbols.h
index 34fff4b962bdcc..69ebfdb5bb356e 100644
--- a/lld/wasm/Symbols.h
+++ b/lld/wasm/Symbols.h
@@ -502,7 +502,7 @@ class LazySymbol : public Symbol {
: Symbol(name, LazyKind, flags, file), archiveSymbol(sym) {}
static bool classof(const Symbol *s) { return s->kind() == LazyKind; }
- void fetch();
+ void extract();
void setWeak();
MemoryBufferRef getMemberBuffer();
``````````
</details>
https://github.com/llvm/llvm-project/pull/78625
More information about the llvm-commits
mailing list