AsmWriter/Bitcode: MDSubrange
llvm-svn: 229003
This commit is contained in:
@@ -1173,6 +1173,8 @@ std::error_code BitcodeReader::ParseValueSymbolTable() {
|
||||
}
|
||||
}
|
||||
|
||||
static int64_t unrotateSign(uint64_t U) { return U & 1 ? ~(U >> 1) : U >> 1; }
|
||||
|
||||
std::error_code BitcodeReader::ParseMetadata() {
|
||||
unsigned NextMDValueNo = MDValueList.size();
|
||||
|
||||
@@ -1349,6 +1351,16 @@ std::error_code BitcodeReader::ParseMetadata() {
|
||||
NextMDValueNo++);
|
||||
break;
|
||||
}
|
||||
case bitc::METADATA_SUBRANGE: {
|
||||
if (Record.size() != 3)
|
||||
return Error("Invalid record");
|
||||
|
||||
MDValueList.AssignValue(
|
||||
GET_OR_DISTINCT(MDSubrange, Record[0],
|
||||
(Context, Record[1], unrotateSign(Record[2]))),
|
||||
NextMDValueNo++);
|
||||
break;
|
||||
}
|
||||
case bitc::METADATA_STRING: {
|
||||
std::string String(Record.begin(), Record.end());
|
||||
llvm::UpgradeMDStringConstant(String);
|
||||
|
||||
Reference in New Issue
Block a user