diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -572,7 +572,7 @@ // Equivalent of demote demoteSharedAndLazySymbols() in the ELF linker static void demoteLazySymbols() { - for (Symbol *sym : symtab->getSymbols()) { + for (Symbol *sym : symtab->symbols()) { if (auto* s = dyn_cast(sym)) { if (s->signature) { LLVM_DEBUG(llvm::dbgs() diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp --- a/lld/wasm/MarkLive.cpp +++ b/lld/wasm/MarkLive.cpp @@ -90,7 +90,7 @@ enqueue(symtab->find(config->entry)); // We need to preserve any no-strip or exported symbol - for (Symbol *sym : symtab->getSymbols()) + for (Symbol *sym : symtab->symbols()) if (sym->isNoStrip() || sym->isExported()) enqueue(sym); diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h --- a/lld/wasm/SymbolTable.h +++ b/lld/wasm/SymbolTable.h @@ -37,14 +37,14 @@ // There is one add* function per symbol type. class SymbolTable { public: + ArrayRef symbols() const { return symVector; } + void wrap(Symbol *sym, Symbol *real, Symbol *wrap); void addFile(InputFile *file); void compileBitcodeFiles(); - ArrayRef getSymbols() const { return symVector; } - Symbol *find(StringRef name); void replace(StringRef name, Symbol* sym); diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp --- a/lld/wasm/SymbolTable.cpp +++ b/lld/wasm/SymbolTable.cpp @@ -854,7 +854,7 @@ // will abort at runtime, so that relocations can still provided an operand to // the call instruction that passes Wasm validation. void SymbolTable::handleWeakUndefines() { - for (Symbol *sym : getSymbols()) { + for (Symbol *sym : symbols()) { if (sym->isUndefWeak() && sym->isUsedInRegularObj) { if (sym->getSignature()) { replaceWithUndefined(sym); diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp --- a/lld/wasm/SyntheticSections.cpp +++ b/lld/wasm/SyntheticSections.cpp @@ -88,7 +88,7 @@ // so that knows not to report an error for such symbols. std::vector importInfo; std::vector exportInfo; - for (const Symbol *sym : symtab->getSymbols()) { + for (const Symbol *sym : symtab->symbols()) { if (sym->isLive()) { if (sym->isExported() && sym->isTLS() && isa(sym)) { exportInfo.push_back(sym); diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -624,7 +624,7 @@ shouldImport(WasmSym::indirectFunctionTable)) out.importSec->addImport(WasmSym::indirectFunctionTable); - for (Symbol *sym : symtab->getSymbols()) { + for (Symbol *sym : symtab->symbols()) { if (!shouldImport(sym)) continue; if (sym == WasmSym::indirectFunctionTable) @@ -645,7 +645,7 @@ unsigned globalIndex = out.importSec->getNumImportedGlobals() + out.globalSec->numGlobals(); - for (Symbol *sym : symtab->getSymbols()) { + for (Symbol *sym : symtab->symbols()) { if (!sym->isExported()) continue; if (!sym->isLive()) @@ -689,7 +689,7 @@ if (!config->relocatable && !config->emitRelocs) return; - for (Symbol *sym : symtab->getSymbols()) + for (Symbol *sym : symtab->symbols()) if (sym->isUsedInRegularObj && sym->isLive()) out.linkingSec->addToSymtab(sym); @@ -743,7 +743,7 @@ std::vector toWrap; - for (Symbol *sym : symtab->getSymbols()) + for (Symbol *sym : symtab->symbols()) if (sym->isExported()) if (auto *f = dyn_cast(sym)) toWrap.push_back(f);