Index: lld/trunk/wasm/Symbols.h =================================================================== --- lld/trunk/wasm/Symbols.h +++ lld/trunk/wasm/Symbols.h @@ -78,9 +78,6 @@ // Only works for globals, not functions. uint32_t getVirtualAddress() const; - // Returns true if an output index has been set for this symbol - bool hasOutputIndex() const { return OutputIndex.hasValue(); } - // Set the output index of the symbol (in the function or global index // space of the output object. void setOutputIndex(uint32_t Index); Index: lld/trunk/wasm/Writer.cpp =================================================================== --- lld/trunk/wasm/Writer.cpp +++ lld/trunk/wasm/Writer.cpp @@ -550,18 +550,16 @@ } void Writer::calculateImports() { - for (ObjFile *File : Symtab->ObjectFiles) { - for (Symbol *Sym : File->getSymbols()) { - if (Sym->hasOutputIndex() || Sym->isDefined() || Sym->isWeak()) - continue; + for (Symbol *Sym : Symtab->getSymbols()) { + if (Sym->isDefined() || Sym->isWeak()) + continue; - if (Sym->isFunction()) { - Sym->setOutputIndex(FunctionImports.size()); - FunctionImports.push_back(Sym); - } else { - Sym->setOutputIndex(GlobalImports.size()); - GlobalImports.push_back(Sym); - } + if (Sym->isFunction()) { + Sym->setOutputIndex(FunctionImports.size()); + FunctionImports.push_back(Sym); + } else { + Sym->setOutputIndex(GlobalImports.size()); + GlobalImports.push_back(Sym); } } }