Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
Show First 20 Lines • Show All 1,615 Lines • ▼ Show 20 Lines | case bitc::METADATA_FILE: { | ||||
// is not present. This matches up with the old internal representation, | // is not present. This matches up with the old internal representation, | ||||
// and the old encoding for CSK_None in the ChecksumKind. The new | // and the old encoding for CSK_None in the ChecksumKind. The new | ||||
// representation reserves the value 0 in the ChecksumKind to continue to | // representation reserves the value 0 in the ChecksumKind to continue to | ||||
// encode None in a backwards-compatible way. | // encode None in a backwards-compatible way. | ||||
if (Record.size() > 4 && Record[3] && Record[4]) | if (Record.size() > 4 && Record[3] && Record[4]) | ||||
Checksum.emplace(static_cast<DIFile::ChecksumKind>(Record[3]), | Checksum.emplace(static_cast<DIFile::ChecksumKind>(Record[3]), | ||||
getMDString(Record[4])); | getMDString(Record[4])); | ||||
MetadataList.assignValue( | MetadataList.assignValue( | ||||
GET_OR_DISTINCT(DIFile, (Context, getMDString(Record[1]), | GET_OR_DISTINCT(DIFile, | ||||
(Context, getMDString(Record[1]), | |||||
getMDString(Record[2]), Checksum, | getMDString(Record[2]), Checksum, | ||||
Record.size() > 5 ? std::optional<MDString *>( | Record.size() > 5 ? getMDString(Record[5]) : nullptr)), | ||||
getMDString(Record[5])) | |||||
: std::nullopt)), | |||||
NextMetadataNo); | NextMetadataNo); | ||||
NextMetadataNo++; | NextMetadataNo++; | ||||
break; | break; | ||||
} | } | ||||
case bitc::METADATA_COMPILE_UNIT: { | case bitc::METADATA_COMPILE_UNIT: { | ||||
if (Record.size() < 14 || Record.size() > 22) | if (Record.size() < 14 || Record.size() > 22) | ||||
return error("Invalid record"); | return error("Invalid record"); | ||||
▲ Show 20 Lines • Show All 768 Lines • Show Last 20 Lines |