[PATCH] D43722: [WebAssembly] Remove premature optimization.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 16:20:41 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326273: [WebAssembly] Remove premature optimization. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43722?vs=135779&id=136174#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43722

Files:
  lld/trunk/wasm/Writer.cpp


Index: lld/trunk/wasm/Writer.cpp
===================================================================
--- lld/trunk/wasm/Writer.cpp
+++ lld/trunk/wasm/Writer.cpp
@@ -895,11 +895,11 @@
 void Writer::calculateInitFunctions() {
   for (ObjFile *File : Symtab->ObjectFiles) {
     const WasmLinkingData &L = File->getWasmObj()->linkingData();
-    InitFunctions.reserve(InitFunctions.size() + L.InitFunctions.size());
     for (const WasmInitFunc &F : L.InitFunctions)
       InitFunctions.emplace_back(
           WasmInitEntry{File->getFunctionSymbol(F.Symbol), F.Priority});
   }
+
   // Sort in order of priority (lowest first) so that they are called
   // in the correct order.
   std::stable_sort(InitFunctions.begin(), InitFunctions.end(),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43722.136174.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/7f7dc70b/attachment.bin>


More information about the llvm-commits mailing list