[PATCH] D77621: Change BitcodeWriter buffer to std::vector instead of SmallVector.

Andrew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 19:38:40 PDT 2020


browneee created this revision.
browneee added a reviewer: dblaikie.
Herald added subscribers: llvm-commits, dexonsmith, steven_wu, hiraditya.
Herald added a project: LLVM.

SmallVector uses 32bit integers for size and capacity, so it is limited to
UINT32_MAX elements. SmallVector was used here with char elements, which
limits bitcode output sizes to 4GB.

Bitcode outputs are not likely to fit in any reasonable size stack allocation,
and may need to exceed 4GB for linked bitcode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77621

Files:
  llvm/include/llvm/Bitcode/BitcodeWriter.h
  llvm/include/llvm/Bitstream/BitstreamWriter.h
  llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp
  llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
  llvm/tools/llvm-cat/llvm-cat.cpp
  llvm/tools/llvm-modextract/llvm-modextract.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77621.255567.patch
Type: text/x-patch
Size: 9023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200407/2703a92d/attachment.bin>


More information about the llvm-commits mailing list