[PATCH] D147548: [lld][WebAssembly] Fix stub library parsing with windows line endings

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 11:53:13 PDT 2023


dschuff accepted this revision.
dschuff added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/wasm/InputFiles.cpp:696
+
+  SmallVector<StringRef, 0> lines;
+  mb.getBuffer().split(lines, '\n');
----------------
I think the SmallVector docs (https://llvm.org/doxygen/classllvm_1_1SmallVector.html#details) recommend leaving out the 2nd template parameter if we don't have a particular best choice for it. 0 seems too small since we know there will be at least a few lines (or maybe just use std::vector since it seems likely there will be heap allocation anyway?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147548/new/

https://reviews.llvm.org/D147548



More information about the llvm-commits mailing list