<div dir="ltr">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.<div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 11, 2014 at 2:30 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dexonsmith<br>
Date: Thu Dec 11 16:30:48 2014<br>
New Revision: 224070<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=224070&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=224070&view=rev</a><br>
Log:<br>
Bitcode: Add `OLD_` prefix to metadata node records<br>
<br>
I'm about to change these, so move the old ones out of the way.<br>
<br>
Part of PR21532.<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h<br>
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp<br>
llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=224070&r1=224069&r2=224070&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=224070&r1=224069&r2=224070&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h (original)<br>
+++ llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h Thu Dec 11 16:30:48 2014<br>
@@ -143,8 +143,8 @@ namespace bitc {<br>
// 5 is unused.<br>
METADATA_KIND = 6, // [n x [id, name]]<br>
// 7 is unused.<br>
- METADATA_NODE = 8, // NODE: [n x (type num, value num)]<br>
- METADATA_FN_NODE = 9, // FN_NODE: [n x (type num, value num)]<br>
+ METADATA_OLD_NODE = 8, // OLD_NODE: [n x (type num, value num)]<br>
+ METADATA_OLD_FN_NODE = 9, // OLD_FN_NODE: [n x (type num, value num)]<br>
METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes]<br>
METADATA_ATTACHMENT = 11 // [m x [value, [n x [id, mdnode]]]<br>
};<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=224070&r1=224069&r2=224070&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=224070&r1=224069&r2=224070&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Dec 11 16:30:48 2014<br>
@@ -1115,7 +1115,7 @@ std::error_code BitcodeReader::ParseMeta<br>
}<br>
break;<br>
}<br>
- case bitc::METADATA_FN_NODE: {<br>
+ case bitc::METADATA_OLD_FN_NODE: {<br>
// This is a LocalAsMetadata record, the only type of function-local<br>
// metadata.<br>
if (Record.size() % 2 == 1)<br>
@@ -1142,7 +1142,7 @@ std::error_code BitcodeReader::ParseMeta<br>
NextMDValueNo++);<br>
break;<br>
}<br>
- case bitc::METADATA_NODE: {<br>
+ case bitc::METADATA_OLD_NODE: {<br>
if (Record.size() % 2 == 1)<br>
return Error(BitcodeError::InvalidRecord);<br>
<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=224070&r1=224069&r2=224070&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=224070&r1=224069&r2=224070&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Dec 11 16:30:48 2014<br>
@@ -754,14 +754,14 @@ static void WriteLocalAsMetadata(const L<br>
const ValueEnumerator &VE,<br>
BitstreamWriter &Stream,<br>
SmallVectorImpl<uint64_t> &Record) {<br>
- WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_FN_NODE);<br>
+ WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_OLD_FN_NODE);<br>
}<br>
<br>
static void WriteConstantAsMetadata(const ConstantAsMetadata *MD,<br>
const ValueEnumerator &VE,<br>
BitstreamWriter &Stream,<br>
SmallVectorImpl<uint64_t> &Record) {<br>
- WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_NODE);<br>
+ WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_OLD_NODE);<br>
}<br>
<br>
static void WriteMDNode(const MDNode *N,<br>
@@ -784,7 +784,7 @@ static void WriteMDNode(const MDNode *N,<br>
Record.push_back(VE.getTypeID(Type::getMetadataTy(N->getContext())));<br>
Record.push_back(VE.getMetadataID(MD));<br>
}<br>
- Stream.EmitRecord(bitc::METADATA_NODE, Record, 0);<br>
+ Stream.EmitRecord(bitc::METADATA_OLD_NODE, Record, 0);<br>
Record.clear();<br>
}<br>
<br>
<br>
Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp?rev=224070&r1=224069&r2=224070&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp?rev=224070&r1=224069&r2=224070&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp (original)<br>
+++ llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Thu Dec 11 16:30:48 2014<br>
@@ -266,8 +266,8 @@ static const char *GetCodeName(unsigned<br>
case bitc::METADATA_STRING: return "METADATA_STRING";<br>
case bitc::METADATA_NAME: return "METADATA_NAME";<br>
case bitc::METADATA_KIND: return "METADATA_KIND";<br>
- case bitc::METADATA_NODE: return "METADATA_NODE";<br>
- case bitc::METADATA_FN_NODE: return "METADATA_FN_NODE";<br>
+ case bitc::METADATA_OLD_NODE: return "METADATA_OLD_NODE";<br>
+ case bitc::METADATA_OLD_FN_NODE: return "METADATA_OLD_FN_NODE";<br>
case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE";<br>
}<br>
case bitc::USELIST_BLOCK_ID:<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>