[llvm] r224070 - Bitcode: Add `OLD_` prefix to metadata node records
Sean Silva
chisophugis at gmail.com
Thu Dec 11 16:56:13 PST 2014
I don't remember off the top of my head, but I think we have some precedent
for how to mark things that "used to be part of the IR and are kept for
compatibility", and I don't think that adding _OLD is it. Maybe grep around
for how some other changes were handled? I think it might be "// Remove in
4.x" comments or something like that.
-- Sean Silva
On Thu, Dec 11, 2014 at 2:30 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:
>
> Author: dexonsmith
> Date: Thu Dec 11 16:30:48 2014
> New Revision: 224070
>
> URL: http://llvm.org/viewvc/llvm-project?rev=224070&view=rev
> Log:
> Bitcode: Add `OLD_` prefix to metadata node records
>
> I'm about to change these, so move the old ones out of the way.
>
> Part of PR21532.
>
> Modified:
> llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
> llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
> llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
> llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
>
> Modified: llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=224070&r1=224069&r2=224070&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h (original)
> +++ llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h Thu Dec 11 16:30:48 2014
> @@ -143,8 +143,8 @@ namespace bitc {
> // 5 is unused.
> METADATA_KIND = 6, // [n x [id, name]]
> // 7 is unused.
> - METADATA_NODE = 8, // NODE: [n x (type num, value
> num)]
> - METADATA_FN_NODE = 9, // FN_NODE: [n x (type num, value
> num)]
> + METADATA_OLD_NODE = 8, // OLD_NODE: [n x (type num, value
> num)]
> + METADATA_OLD_FN_NODE = 9, // OLD_FN_NODE: [n x (type num, value
> num)]
> METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes]
> METADATA_ATTACHMENT = 11 // [m x [value, [n x [id, mdnode]]]
> };
>
> Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=224070&r1=224069&r2=224070&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Dec 11 16:30:48
> 2014
> @@ -1115,7 +1115,7 @@ std::error_code BitcodeReader::ParseMeta
> }
> break;
> }
> - case bitc::METADATA_FN_NODE: {
> + case bitc::METADATA_OLD_FN_NODE: {
> // This is a LocalAsMetadata record, the only type of function-local
> // metadata.
> if (Record.size() % 2 == 1)
> @@ -1142,7 +1142,7 @@ std::error_code BitcodeReader::ParseMeta
> NextMDValueNo++);
> break;
> }
> - case bitc::METADATA_NODE: {
> + case bitc::METADATA_OLD_NODE: {
> if (Record.size() % 2 == 1)
> return Error(BitcodeError::InvalidRecord);
>
>
> Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=224070&r1=224069&r2=224070&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
> +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Dec 11 16:30:48
> 2014
> @@ -754,14 +754,14 @@ static void WriteLocalAsMetadata(const L
> const ValueEnumerator &VE,
> BitstreamWriter &Stream,
> SmallVectorImpl<uint64_t> &Record) {
> - WriteValueAsMetadataImpl(MD, VE, Stream, Record,
> bitc::METADATA_FN_NODE);
> + WriteValueAsMetadataImpl(MD, VE, Stream, Record,
> bitc::METADATA_OLD_FN_NODE);
> }
>
> static void WriteConstantAsMetadata(const ConstantAsMetadata *MD,
> const ValueEnumerator &VE,
> BitstreamWriter &Stream,
> SmallVectorImpl<uint64_t> &Record) {
> - WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_NODE);
> + WriteValueAsMetadataImpl(MD, VE, Stream, Record,
> bitc::METADATA_OLD_NODE);
> }
>
> static void WriteMDNode(const MDNode *N,
> @@ -784,7 +784,7 @@ static void WriteMDNode(const MDNode *N,
> Record.push_back(VE.getTypeID(Type::getMetadataTy(N->getContext())));
> Record.push_back(VE.getMetadataID(MD));
> }
> - Stream.EmitRecord(bitc::METADATA_NODE, Record, 0);
> + Stream.EmitRecord(bitc::METADATA_OLD_NODE, Record, 0);
> Record.clear();
> }
>
>
> Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp?rev=224070&r1=224069&r2=224070&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp (original)
> +++ llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Thu Dec 11
> 16:30:48 2014
> @@ -266,8 +266,8 @@ static const char *GetCodeName(unsigned
> case bitc::METADATA_STRING: return "METADATA_STRING";
> case bitc::METADATA_NAME: return "METADATA_NAME";
> case bitc::METADATA_KIND: return "METADATA_KIND";
> - case bitc::METADATA_NODE: return "METADATA_NODE";
> - case bitc::METADATA_FN_NODE: return "METADATA_FN_NODE";
> + case bitc::METADATA_OLD_NODE: return "METADATA_OLD_NODE";
> + case bitc::METADATA_OLD_FN_NODE: return "METADATA_OLD_FN_NODE";
> case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE";
> }
> case bitc::USELIST_BLOCK_ID:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141211/f970aaa6/attachment.html>
More information about the llvm-commits
mailing list