[Bitcode] Store type IDs for values
authorNikita Popov <npopov@redhat.com>
Mon, 14 Feb 2022 16:00:41 +0000 (17:00 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 22 Feb 2022 16:27:06 +0000 (17:27 +0100)
commitb6eafba296fc0444892a176ccc3cb947399b408c
treecfed2de41c04ae53b6d1dac1aa5ae49972d69b11
parent79c9072dc009693477242bc1347a2a6c3e419423
[Bitcode] Store type IDs for values

This is the next step towards supporting bitcode auto upgrade with
opaque pointers. The ValueList now stores the Value* together with
its associated type ID, which allows inspecting the original pointer
element type of arbitrary values.

This is a largely mechanical change threading the type ID through
various places. I've left TODOTypeID placeholders in a number of
places where determining the type ID is either non-trivial or
requires allocating a new type ID not present in the original
bitcode. For this reason, the new type IDs are also not used for
anything yet (apart from propagation). They will get used once the
TODOs are resolved.

Differential Revision: https://reviews.llvm.org/D119821
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/Bitcode/Reader/ValueList.cpp
llvm/lib/Bitcode/Reader/ValueList.h