Skip to content

Commit

Permalink
Remove some "2" suffixes from the metadata enums now that "1" is gone.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133269 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Jun 17, 2011
1 parent 020a5a4 commit 9d61dd9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions include/llvm/Bitcode/LLVMBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ namespace bitc {
// 5 is unused.
METADATA_KIND = 6, // [n x [id, name]]
// 7 is unused.
METADATA_NODE2 = 8, // NODE2: [n x (type num, value num)]
METADATA_FN_NODE2 = 9, // FN_NODE2: [n x (type num, value num)]
METADATA_NAMED_NODE2 = 10, // NAMED_NODE2: [n x mdnodes]
METADATA_ATTACHMENT2 = 11 // [m x [value, [n x [id, mdnode]]]
METADATA_NODE = 8, // NODE: [n x (type num, value num)]
METADATA_FN_NODE = 9, // 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]]]
};
// The constants block (CONSTANTS_BLOCK_ID) describes emission for each
// constant and maintains an implicit current type value.
Expand Down
14 changes: 7 additions & 7 deletions lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,9 @@ bool BitcodeReader::ParseMetadata() {
Record.clear();
Code = Stream.ReadCode();

// METADATA_NAME is always followed by METADATA_NAMED_NODE2.
// METADATA_NAME is always followed by METADATA_NAMED_NODE.
unsigned NextBitCode = Stream.ReadRecord(Code, Record);
assert(NextBitCode == bitc::METADATA_NAMED_NODE2); (void)NextBitCode;
assert(NextBitCode == bitc::METADATA_NAMED_NODE); (void)NextBitCode;

// Read named metadata elements.
unsigned Size = Record.size();
Expand All @@ -805,18 +805,18 @@ bool BitcodeReader::ParseMetadata() {
}
break;
}
case bitc::METADATA_FN_NODE2:
case bitc::METADATA_FN_NODE:
IsFunctionLocal = true;
// fall-through
case bitc::METADATA_NODE2: {
case bitc::METADATA_NODE: {
if (Record.size() % 2 == 1)
return Error("Invalid METADATA_NODE2 record");
return Error("Invalid METADATA_NODE record");

unsigned Size = Record.size();
SmallVector<Value*, 8> Elts;
for (unsigned i = 0; i != Size; i += 2) {
const Type *Ty = getTypeByID(Record[i]);
if (!Ty) return Error("Invalid METADATA_NODE2 record");
if (!Ty) return Error("Invalid METADATA_NODE record");
if (Ty->isMetadataTy())
Elts.push_back(MDValueList.getValueFwdRef(Record[i+1]));
else if (!Ty->isVoidTy())
Expand Down Expand Up @@ -1736,7 +1736,7 @@ bool BitcodeReader::ParseMetadataAttachment() {
switch (Stream.ReadRecord(Code, Record)) {
default: // Default behavior: ignore.
break;
case bitc::METADATA_ATTACHMENT2: {
case bitc::METADATA_ATTACHMENT: {
unsigned RecordLength = Record.size();
if (Record.empty() || (RecordLength - 1) % 2 == 1)
return Error ("Invalid METADATA_ATTACHMENT reader!");
Expand Down
8 changes: 4 additions & 4 deletions tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,17 @@ static const char *GetCodeName(unsigned CodeID, unsigned BlockID,
case bitc::METADATA_ATTACHMENT_ID:
switch(CodeID) {
default:return 0;
case bitc::METADATA_ATTACHMENT2: return "METADATA_ATTACHMENT2";
case bitc::METADATA_ATTACHMENT: return "METADATA_ATTACHMENT";
}
case bitc::METADATA_BLOCK_ID:
switch(CodeID) {
default:return 0;
case bitc::METADATA_STRING: return "METADATA_STRING";
case bitc::METADATA_NAME: return "METADATA_NAME";
case bitc::METADATA_KIND: return "METADATA_KIND";
case bitc::METADATA_NODE2: return "METADATA_NODE2";
case bitc::METADATA_FN_NODE2: return "METADATA_FN_NODE2";
case bitc::METADATA_NAMED_NODE2: return "METADATA_NAMED_NODE2";
case bitc::METADATA_NODE: return "METADATA_NODE";
case bitc::METADATA_FN_NODE: return "METADATA_FN_NODE";
case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE";
}
}
}
Expand Down

0 comments on commit 9d61dd9

Please sign in to comment.