[PATCH] D41304: [WebAssembly] Base imports on Symtab. NFC.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 11:24:35 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL320847: [WebAssembly] Base imports on Symtab. NFC. (authored by sbc, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D41304

Files:
  lld/trunk/wasm/Symbols.h
  lld/trunk/wasm/Writer.cpp


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);
     }
   }
 }
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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41304.127165.patch
Type: text/x-patch
Size: 1540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171215/56d03f72/attachment.bin>


More information about the llvm-commits mailing list