[lld] r326888 - [WebAssembly] Remove duplicated line of code and unreachable check. NFC

Nicholas Wilson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 03:15:47 PST 2018


Author: ncw
Date: Wed Mar  7 03:15:47 2018
New Revision: 326888

URL: http://llvm.org/viewvc/llvm-project?rev=326888&view=rev
Log:
[WebAssembly] Remove duplicated line of code and unreachable check. NFC

Differential Revision: https://reviews.llvm.org/D44146

Modified:
    lld/trunk/wasm/Writer.cpp

Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=326888&r1=326887&r2=326888&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Wed Mar  7 03:15:47 2018
@@ -694,8 +694,9 @@ void Writer::assignSymtab() {
     for (Symbol *Sym : File->getSymbols()) {
       if (Sym->getFile() != File)
         continue;
-      if (!Sym->isLive())
-        return;
+      // (Since this is relocatable output, GC is not performed so symbols must
+      // be live.)
+      assert(Sym->isLive());
       Sym->setOutputSymbolIndex(SymbolIndex++);
       SymtabEntries.emplace_back(Sym);
     }
@@ -850,7 +851,6 @@ static const int OPCODE_END = 0xb;
 // in input object.
 void Writer::createCtorFunction() {
   uint32_t FunctionIndex = NumImportedFunctions + InputFunctions.size();
-  WasmSym::CallCtors->setOutputIndex(FunctionIndex);
 
   // First write the body's contents to a string.
   std::string BodyContent;




More information about the llvm-commits mailing list