[LTO] Fix assertion failed when flushing bitcode incrementally for LTO output.
In https://reviews.llvm.org/D86905, we introduce an optimization, when lld emits LLVM bitcode, we allow bitcode writer flush data to disk early when buffered data size is above some threshold. But when `--plugin-opt=emit-llvm` and `-o /dev/null` are used, lld will trigger assertion `BytesRead >= 0 && static_cast<size_t>(BytesRead) == BytesFromDisk`. When we write output to /dev/null, BytesRead is zero, but at this program point BytesFromDisk is always non-zero. Reviewed By: stephan.yichao.zhao, MaskRay Differential Revision: https://reviews.llvm.org/D112297
Loading
Please register or sign in to comment