[PATCH] D44146: [WebAssembly] Remove duplicated line of code and unreachable check. NFC

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 14:32:17 PST 2018


ncw added inline comments.


================
Comment at: wasm/Writer.cpp:696
         continue;
-      if (!Sym->isLive())
-        return;
+      assert(Sym->isLive());
       Sym->setOutputSymbolIndex(SymbolIndex++);
----------------
sbc100 wrote:
> But this isn't iterating the symbol table, its iterating all symbols in all the objects. Surely some of them can be non-live.  I don't quite understand why we not hitting this case in some unit test.
The entire method `Writer::assignSymtab` has an early-exit for non-relocatable output. So all symbols are always Live when generating a symtab, since that's the relocatable case (and GC and relocatable are exclusive).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44146





More information about the llvm-commits mailing list