This is an archive of the discontinued LLVM Phabricator instance.

Bitcode: Change expected layout of module blocks.
ClosedPublic

Authored by pcc on Nov 28 2016, 6:17 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 79492.Nov 28 2016, 6:17 PM
pcc retitled this revision from to Bitcode: Change expected layout of module blocks..
pcc updated this object.
pcc added a reviewer: mehdi_amini.
pcc added a subscriber: llvm-commits.
mehdi_amini accepted this revision.Nov 28 2016, 6:27 PM
mehdi_amini edited edge metadata.

LGTM!
Thanks.

llvm/lib/Bitcode/Reader/BitcodeReader.cpp
2311 ↗(On Diff #79492)

Is "historically always the start of the file" correct on Darwin?

This revision is now accepted and ready to land.Nov 28 2016, 6:27 PM
pcc marked an inline comment as done.Nov 28 2016, 6:36 PM
pcc added inline comments.
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
2311 ↗(On Diff #79492)

I suppose not, fixed.

This revision was automatically updated to reflect the committed changes.
pcc marked an inline comment as done.