[PATCH] D86847: [Bitcode] Add BITCODE_SIZE_BLOCK_ID to encode the size of the bitcode

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 15:57:32 PDT 2020


MaskRay added a comment.

The idea is to add a terminator block, but a terminator carries less information so this patch intends to add a size block instead. With a terminator, the following problem can be better addressed

  // We may be consuming bitcode from a client that leaves garbage at the end
  // of the bitcode stream (e.g. Apple's ar tool). If we are close enough to
  // the end that there cannot possibly be another module, stop looking.

If the container does not expect more than one bitcode stream. Then after passing one stream, it can bail out.
For users who want to have multiple streams, they can strip any padding. The scheme will automatically work with most binary formats (alignment=1).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86847



More information about the llvm-commits mailing list