llvm.org GIT mirror llvm / 934da0f
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224070 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 5 years ago
4 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
142142 // 5 is unused.
143143 METADATA_KIND = 6, // [n x [id, name]]
144144 // 7 is unused.
145 METADATA_NODE = 8, // NODE: [n x (type num, value num)]
146 METADATA_FN_NODE = 9, // FN_NODE: [n x (type num, value num)]
145 METADATA_OLD_NODE = 8, // OLD_NODE: [n x (type num, value num)]
146 METADATA_OLD_FN_NODE = 9, // OLD_FN_NODE: [n x (type num, value num)]
147147 METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes]
148148 METADATA_ATTACHMENT = 11 // [m x [value, [n x [id, mdnode]]]
149149 };
11141114 }
11151115 break;
11161116 }
1117 case bitc::METADATA_FN_NODE: {
1117 case bitc::METADATA_OLD_FN_NODE: {
11181118 // This is a LocalAsMetadata record, the only type of function-local
11191119 // metadata.
11201120 if (Record.size() % 2 == 1)
11411141 NextMDValueNo++);
11421142 break;
11431143 }
1144 case bitc::METADATA_NODE: {
1144 case bitc::METADATA_OLD_NODE: {
11451145 if (Record.size() % 2 == 1)
11461146 return Error(BitcodeError::InvalidRecord);
11471147
753753 const ValueEnumerator &VE,
754754 BitstreamWriter &Stream,
755755 SmallVectorImpl &Record) {
756 WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_FN_NODE);
756 WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_OLD_FN_NODE);
757757 }
758758
759759 static void WriteConstantAsMetadata(const ConstantAsMetadata *MD,
760760 const ValueEnumerator &VE,
761761 BitstreamWriter &Stream,
762762 SmallVectorImpl &Record) {
763 WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_NODE);
763 WriteValueAsMetadataImpl(MD, VE, Stream, Record, bitc::METADATA_OLD_NODE);
764764 }
765765
766766 static void WriteMDNode(const MDNode *N,
783783 Record.push_back(VE.getTypeID(Type::getMetadataTy(N->getContext())));
784784 Record.push_back(VE.getMetadataID(MD));
785785 }
786 Stream.EmitRecord(bitc::METADATA_NODE, Record, 0);
786 Stream.EmitRecord(bitc::METADATA_OLD_NODE, Record, 0);
787787 Record.clear();
788788 }
789789
265265 case bitc::METADATA_STRING: return "METADATA_STRING";
266266 case bitc::METADATA_NAME: return "METADATA_NAME";
267267 case bitc::METADATA_KIND: return "METADATA_KIND";
268 case bitc::METADATA_NODE: return "METADATA_NODE";
269 case bitc::METADATA_FN_NODE: return "METADATA_FN_NODE";
268 case bitc::METADATA_OLD_NODE: return "METADATA_OLD_NODE";
269 case bitc::METADATA_OLD_FN_NODE: return "METADATA_OLD_FN_NODE";
270270 case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE";
271271 }
272272 case bitc::USELIST_BLOCK_ID: