forked from OSchip/llvm-project
[lld][WebAssembly] Rename SymbolTable::getSymbols to match ELF backend. NFC
The ELF backend originally used `getSymbols()` but went though a sequence of changes that resulted in this method being called `symbols()`.d8f8abbd4a
replaced `getSymbols()` with `forEachSymbol`.a2fc964417
replaced `forEachSymbol` with `llvm::iterator_range`.e9262edf0d
replaced `llvm::iterator_range` with `symbols()`. Differential Revision: https://reviews.llvm.org/D131284
This commit is contained in:
parent
c5c4ba37b1
commit
113b568829
|
@ -572,7 +572,7 @@ static void handleLibcall(StringRef name) {
|
|||
|
||||
// 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<LazySymbol>(sym)) {
|
||||
if (s->signature) {
|
||||
LLVM_DEBUG(llvm::dbgs()
|
||||
|
|
|
@ -90,7 +90,7 @@ void MarkLive::run() {
|
|||
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);
|
||||
|
||||
|
|
|
@ -854,7 +854,7 @@ void SymbolTable::replaceWithUndefined(Symbol *sym) {
|
|||
// 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);
|
||||
|
|
|
@ -37,14 +37,14 @@ class InputSegment;
|
|||
// There is one add* function per symbol type.
|
||||
class SymbolTable {
|
||||
public:
|
||||
ArrayRef<Symbol *> symbols() const { return symVector; }
|
||||
|
||||
void wrap(Symbol *sym, Symbol *real, Symbol *wrap);
|
||||
|
||||
void addFile(InputFile *file);
|
||||
|
||||
void compileBitcodeFiles();
|
||||
|
||||
ArrayRef<Symbol *> getSymbols() const { return symVector; }
|
||||
|
||||
Symbol *find(StringRef name);
|
||||
|
||||
void replace(StringRef name, Symbol* sym);
|
||||
|
|
|
@ -88,7 +88,7 @@ void DylinkSection::writeBody() {
|
|||
// so that knows not to report an error for such symbols.
|
||||
std::vector<const Symbol *> importInfo;
|
||||
std::vector<const Symbol *> exportInfo;
|
||||
for (const Symbol *sym : symtab->getSymbols()) {
|
||||
for (const Symbol *sym : symtab->symbols()) {
|
||||
if (sym->isLive()) {
|
||||
if (sym->isExported() && sym->isTLS() && isa<DefinedData>(sym)) {
|
||||
exportInfo.push_back(sym);
|
||||
|
|
|
@ -624,7 +624,7 @@ void Writer::calculateImports() {
|
|||
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 @@ void Writer::calculateExports() {
|
|||
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 @@ void Writer::populateSymtab() {
|
|||
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 @@ void Writer::createCommandExportWrappers() {
|
|||
|
||||
std::vector<DefinedFunction *> toWrap;
|
||||
|
||||
for (Symbol *sym : symtab->getSymbols())
|
||||
for (Symbol *sym : symtab->symbols())
|
||||
if (sym->isExported())
|
||||
if (auto *f = dyn_cast<DefinedFunction>(sym))
|
||||
toWrap.push_back(f);
|
||||
|
|
Loading…
Reference in New Issue