[lld] [lld][WebAssembly] Match the ELF linker in transitioning away from archive indexes. (PR #78658)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 18:03:28 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 8649328060b4e748502d1d859f9c9c1bd3c2bccc cec8f8079b9bad00901e85015fafcd642bb4308b -- lld/wasm/Driver.cpp lld/wasm/InputFiles.cpp lld/wasm/InputFiles.h lld/wasm/SymbolTable.cpp lld/wasm/SymbolTable.h lld/wasm/Symbols.cpp lld/wasm/Symbols.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 9e038b6db6..7a094a6091 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -752,7 +752,7 @@ static void writeWhyExtract() {
// Equivalent of demote demoteSharedAndLazySymbols() in the ELF linker
static void demoteLazySymbols() {
for (Symbol *sym : symtab->symbols()) {
- if (auto* s = dyn_cast<LazyObject>(sym)) {
+ if (auto *s = dyn_cast<LazyObject>(sym)) {
if (s->signature) {
LLVM_DEBUG(llvm::dbgs()
<< "demoting lazy func: " << s->getName() << "\n");
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 92a1694ae0..e56796d8ac 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -392,9 +392,9 @@ void ObjFile::parseLazy() {
if (!wasmSym.isDefined())
continue;
symtab->addLazy(wasmSym.Info.Name, this);
- // addLazy() may trigger this->extract() if an existing symbol is an undefined
- // symbol. If that happens, this function has served its purpose, and we can
- // exit from the loop early.
+ // addLazy() may trigger this->extract() if an existing symbol is an
+ // undefined symbol. If that happens, this function has served its purpose,
+ // and we can exit from the loop early.
if (!lazy)
break;
}
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index bc2685564c..05a0e899a1 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -24,7 +24,8 @@ namespace lld::wasm {
SymbolTable *symtab;
void SymbolTable::addFile(InputFile *file, StringRef symName) {
- log("Processing " + toString(file) + " (lazy=" + Twine(file->lazy) + " symName=" + symName + ")");
+ log("Processing " + toString(file) + " (lazy=" + Twine(file->lazy) +
+ " symName=" + symName + ")");
// Lazy object file
if (file->lazy) {
@@ -766,7 +767,8 @@ void SymbolTable::addLazy(StringRef name, InputFile *file) {
if (auto *f = dyn_cast<UndefinedFunction>(s))
oldSig = f->signature;
LLVM_DEBUG(dbgs() << "replacing existing weak undefined symbol\n");
- auto newSym = replaceSymbol<LazyObject>(s, name, WASM_SYMBOL_BINDING_WEAK, file);
+ auto newSym =
+ replaceSymbol<LazyObject>(s, name, WASM_SYMBOL_BINDING_WEAK, file);
newSym->signature = oldSig;
return;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/78658
More information about the llvm-commits
mailing list