[PATCH] D54687: [WebAssembly] Make starting indices calcaulation simpler (NFC)

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 15:24:18 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL347272: [WebAssembly] Make starting indices calcaulation simpler (NFC) (authored by aheejin, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D54687

Files:
  lld/trunk/wasm/Writer.cpp


Index: lld/trunk/wasm/Writer.cpp
===================================================================
--- lld/trunk/wasm/Writer.cpp
+++ lld/trunk/wasm/Writer.cpp
@@ -891,7 +891,8 @@
 }
 
 void Writer::assignIndexes() {
-  uint32_t FunctionIndex = NumImportedFunctions + InputFunctions.size();
+  assert(InputFunctions.empty());
+  uint32_t FunctionIndex = NumImportedFunctions;
   auto AddDefinedFunction = [&](InputFunction *Func) {
     if (!Func->Live)
       return;
@@ -940,7 +941,8 @@
       HandleRelocs(P);
   }
 
-  uint32_t GlobalIndex = NumImportedGlobals + InputGlobals.size();
+  assert(InputGlobals.empty());
+  uint32_t GlobalIndex = NumImportedGlobals;
   auto AddDefinedGlobal = [&](InputGlobal *Global) {
     if (Global->Live) {
       LLVM_DEBUG(dbgs() << "AddDefinedGlobal: " << GlobalIndex << "\n");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54687.174694.patch
Type: text/x-patch
Size: 821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181119/eb20223c/attachment.bin>


More information about the llvm-commits mailing list