[ThinLTO] Add MODULE_CODE_METADATA_VALUES record
authorTeresa Johnson <tejohnson@google.com>
Fri, 20 Nov 2015 14:51:27 +0000 (14:51 +0000)
committerTeresa Johnson <tejohnson@google.com>
Fri, 20 Nov 2015 14:51:27 +0000 (14:51 +0000)
commit086ed798ff99f87ddf63184138d5797382c9a0f6
treedc70998c0544fc0ed132e66e33c8244b9372391d
parent72bf3d33aa1b7e50bca13eecf576011fcc327d51
[ThinLTO] Add MODULE_CODE_METADATA_VALUES record

Summary:
This is split out from the ThinLTO metadata mapping patch
http://reviews.llvm.org/D14752.

To avoid needing to parse the module level metadata during function
importing, a new module-level record is added which holds the
number of module-level metadata values. This is required because
metadata value ids are assigned implicitly during parsing, and the
function-level metadata ids start after the module-level metadata ids.

I made a change to this version of the code compared to D14752
in order to add more consistent and thorough assertion checking of the
new record value. We now unconditionally use the record value to
initialize the MDValueList size, and handle it the same in parseMetadata
for all module level metadata cases (lazy loading or not).

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D14825

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253668 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/LLVMBitCodes.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/Bitcode/Writer/ValueEnumerator.h
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp