Bitcode: Add METADATA_NODE and METADATA_VALUE
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Dec 2014 23:02:24 +0000 (23:02 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Dec 2014 23:02:24 +0000 (23:02 +0000)
commite39dba9f078041e4bca7e821dfb252c1cc4a3fee
tree4e5e9f40c64c3ece0acab807bf38bd588d39ba88
parentf329765d2304e2ab3eccd7760727513539874c93
Bitcode: Add METADATA_NODE and METADATA_VALUE

This reflects the typelessness of `Metadata` in the bitcode format,
removing types from all metadata operands.

`METADATA_VALUE` represents a `ValueAsMetadata`, and always has two
fields: the type and the value.

`METADATA_NODE` represents an `MDNode`, and unlike `METADATA_OLD_NODE`,
doesn't store types.  It stores operands at their ID+1 so that `0` can
reference `nullptr` operands.

Part of PR21532.

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