[PATCH] D14654: Use a different block id for block of metadata kind records

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 06:27:43 PST 2015


tejohnson created this revision.
tejohnson added reviewers: dexonsmith, joker.eph.
tejohnson added subscribers: llvm-commits, davidxl.

There are currently two blocks with the METADATA_BLOCK id at module
scope. The first has the module-level metadata values (consisting of
some combination of METADATA_* record codes except for METADATA_KIND).
The second consists only of METADATA_KIND records. The latter is used
only in the METADATA_ATTACHMENT block within function blocks (for
metadata attached to instructions).

For ThinLTO we want to delay the parsing of module level metadata
until all functions have been imported from that module (there is some
bookkeeping used to suture it up when we read it during a post-pass).
However, we do need the METADATA_KIND records when parsing the function
body during importing, since those kinds are used as described above.

To simplify identification and parsing of just the block containing
the metadata kinds, use a different block id (METADATA_KIND_BLOCK_ID).
Support older bitcode without the new block id as well.

http://reviews.llvm.org/D14654

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14654.40146.patch
Type: text/x-patch
Size: 5783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151113/94e9fbe1/attachment.bin>


More information about the llvm-commits mailing list