Bitcode: Change expected layout of module blocks.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 29 Nov 2016 02:27:04 +0000 (02:27 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 29 Nov 2016 02:27:04 +0000 (02:27 +0000)
commitbfcf9800b815ee2aba4165a1c0a4b33e6f6d5dc1
treee21029b543879d8218a105721f41d133673798a9
parent9bb192ed99969b19e420d91ad5f1573169bcafaa
Bitcode: Change expected layout of module blocks.

We now expect each module's identification block to appear immediately before
the module block. Any module block that appears without an identification block
immediately before it is interpreted as if it does not have a module block.

Also change the interpretation of VST and function offsets in bitcode.
The offset is always taken as relative to the start of the identification
(or module if not present) block, minus one word. This corresponds to the
historical interpretation of offsets, i.e. relative to the start of the file.

These changes allow for bitcode modules to be concatenated by copying bytes.

Differential Revision: https://reviews.llvm.org/D27184

llvm-svn: 288098
llvm/include/llvm/Bitcode/BitcodeReader.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp