Function bitcode index in Value Symbol Table and lazy reading support
authorTeresa Johnson <tejohnson@google.com>
Thu, 17 Sep 2015 15:52:30 +0000 (15:52 +0000)
committerTeresa Johnson <tejohnson@google.com>
Thu, 17 Sep 2015 15:52:30 +0000 (15:52 +0000)
commit1f05ba2fcb8063468aabfc81c9a82b8da211bb6c
tree5963ba490068b7b05009ea074f87025bcbcf481d
parentdaaec40323619188f16f744af624de4b30755f56
Function bitcode index in Value Symbol Table and lazy reading support

Summary:
Support for including the function bitcode indices in the Value Symbol
Table. This requires writing the VST after the function blocks, which in
turn requires a new VST forward declaration record encoding the offset of
the full VST (which is backpatched to contain the offset after the VST
is written).

This patch also enables the lazy function reader to use the new function
indices out of the VST. This support will be used by ThinLTO as well, which
will be in a follow on patch. Backwards compatibility with older bitcode
files is maintained.

A new test is also included.

The bitcode format (used for the lazy reader as well as the upcoming
ThinLTO patches) came out of discussions with Duncan and others and is
described here:
https://drive.google.com/file/d/0B036uwnWM6RWdnBLakxmeDdOeXc/view

Reviewers: dexonsmith, davidxl, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247894 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/LLVMBitCodes.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
test/Bitcode/vst-forward-declaration.ll [new file with mode: 0644]
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp