[llvm] Unittests and usability for BitstreamWriter incremental flushing (PR #92983)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed May 29 12:19:34 PDT 2024
================
@@ -5047,27 +5050,28 @@ void llvm::WriteBitcodeToFile(const Module &M, raw_ostream &Out,
bool ShouldPreserveUseListOrder,
const ModuleSummaryIndex *Index,
bool GenerateHash, ModuleHash *ModHash) {
- SmallVector<char, 0> Buffer;
- Buffer.reserve(256*1024);
-
- // If this is darwin or another generic macho target, reserve space for the
- // header.
+ auto Write = [&](BitcodeWriter &Writer) {
+ Writer.writeModule(M, ShouldPreserveUseListOrder, Index, GenerateHash,
+ ModHash);
+ Writer.writeSymtab();
+ Writer.writeStrtab();
+ };
Triple TT(M.getTargetTriple());
- if (TT.isOSDarwin() || TT.isOSBinFormatMachO())
+ if (TT.isOSDarwin() || TT.isOSBinFormatMachO()) {
+ // If this is darwin or another generic macho target, reserve space for the
+ // header. Note that the header is computed *after* the output is known, so
+ // we currently expliclty use a buffer, write to it, and then subsequently
----------------
teresajohnson wrote:
typo "expliclty"
https://github.com/llvm/llvm-project/pull/92983
More information about the llvm-commits
mailing list