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
This commit is contained in:
Duncan P. N. Exon Smith 2014-12-11 22:30:48 +00:00
parent 9dd31e8016
commit 934da0fc3f
4 changed files with 9 additions and 9 deletions

View File

@ -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]]]
};

View File

@ -1115,7 +1115,7 @@ std::error_code BitcodeReader::ParseMetadata() {
}
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::ParseMetadata() {
NextMDValueNo++);
break;
}
case bitc::METADATA_NODE: {
case bitc::METADATA_OLD_NODE: {
if (Record.size() % 2 == 1)
return Error(BitcodeError::InvalidRecord);

View File

@ -754,14 +754,14 @@ static void WriteLocalAsMetadata(const LocalAsMetadata *MD,
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();
}

View File

@ -266,8 +266,8 @@ static const char *GetCodeName(unsigned CodeID, unsigned BlockID,
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: