llvm.org GIT mirror llvm / 9d61dd9
Remove some "2" suffixes from the metadata enums now that "1" is gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133269 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
3 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
117117 // 5 is unused.
118118 METADATA_KIND = 6, // [n x [id, name]]
119119 // 7 is unused.
120 METADATA_NODE2 = 8, // NODE2: [n x (type num, value num)]
121 METADATA_FN_NODE2 = 9, // FN_NODE2: [n x (type num, value num)]
122 METADATA_NAMED_NODE2 = 10, // NAMED_NODE2: [n x mdnodes]
123 METADATA_ATTACHMENT2 = 11 // [m x [value, [n x [id, mdnode]]]
120 METADATA_NODE = 8, // NODE: [n x (type num, value num)]
121 METADATA_FN_NODE = 9, // FN_NODE: [n x (type num, value num)]
122 METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes]
123 METADATA_ATTACHMENT = 11 // [m x [value, [n x [id, mdnode]]]
124124 };
125125 // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
126126 // constant and maintains an implicit current type value.
789789 Record.clear();
790790 Code = Stream.ReadCode();
791791
792 // METADATA_NAME is always followed by METADATA_NAMED_NODE2.
792 // METADATA_NAME is always followed by METADATA_NAMED_NODE.
793793 unsigned NextBitCode = Stream.ReadRecord(Code, Record);
794 assert(NextBitCode == bitc::METADATA_NAMED_NODE2); (void)NextBitCode;
794 assert(NextBitCode == bitc::METADATA_NAMED_NODE); (void)NextBitCode;
795795
796796 // Read named metadata elements.
797797 unsigned Size = Record.size();
804804 }
805805 break;
806806 }
807 case bitc::METADATA_FN_NODE2:
807 case bitc::METADATA_FN_NODE:
808808 IsFunctionLocal = true;
809809 // fall-through
810 case bitc::METADATA_NODE2: {
810 case bitc::METADATA_NODE: {
811811 if (Record.size() % 2 == 1)
812 return Error("Invalid METADATA_NODE2 record");
812 return Error("Invalid METADATA_NODE record");
813813
814814 unsigned Size = Record.size();
815815 SmallVector Elts;
816816 for (unsigned i = 0; i != Size; i += 2) {
817817 const Type *Ty = getTypeByID(Record[i]);
818 if (!Ty) return Error("Invalid METADATA_NODE2 record");
818 if (!Ty) return Error("Invalid METADATA_NODE record");
819819 if (Ty->isMetadataTy())
820820 Elts.push_back(MDValueList.getValueFwdRef(Record[i+1]));
821821 else if (!Ty->isVoidTy())
17351735 switch (Stream.ReadRecord(Code, Record)) {
17361736 default: // Default behavior: ignore.
17371737 break;
1738 case bitc::METADATA_ATTACHMENT2: {
1738 case bitc::METADATA_ATTACHMENT: {
17391739 unsigned RecordLength = Record.size();
17401740 if (Record.empty() || (RecordLength - 1) % 2 == 1)
17411741 return Error ("Invalid METADATA_ATTACHMENT reader!");
261261 case bitc::METADATA_ATTACHMENT_ID:
262262 switch(CodeID) {
263263 default:return 0;
264 case bitc::METADATA_ATTACHMENT2: return "METADATA_ATTACHMENT2";
264 case bitc::METADATA_ATTACHMENT: return "METADATA_ATTACHMENT";
265265 }
266266 case bitc::METADATA_BLOCK_ID:
267267 switch(CodeID) {
269269 case bitc::METADATA_STRING: return "METADATA_STRING";
270270 case bitc::METADATA_NAME: return "METADATA_NAME";
271271 case bitc::METADATA_KIND: return "METADATA_KIND";
272 case bitc::METADATA_NODE2: return "METADATA_NODE2";
273 case bitc::METADATA_FN_NODE2: return "METADATA_FN_NODE2";
274 case bitc::METADATA_NAMED_NODE2: return "METADATA_NAMED_NODE2";
272 case bitc::METADATA_NODE: return "METADATA_NODE";
273 case bitc::METADATA_FN_NODE: return "METADATA_FN_NODE";
274 case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE";
275275 }
276276 }
277277 }