mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
[DebugInfo] Unify ChecksumKind and Checksum value in DIFile
Rather than encode the absence of a checksum with a Kind variant, instead put both the kind and value in a struct and wrap it in an Optional. Differential Revision: http://reviews.llvm.org/D43043 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324928 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1551,8 +1551,15 @@ void ModuleBitcodeWriter::writeDIFile(const DIFile *N,
|
||||
Record.push_back(N->isDistinct());
|
||||
Record.push_back(VE.getMetadataOrNullID(N->getRawFilename()));
|
||||
Record.push_back(VE.getMetadataOrNullID(N->getRawDirectory()));
|
||||
Record.push_back(N->getChecksumKind());
|
||||
Record.push_back(VE.getMetadataOrNullID(N->getRawChecksum()));
|
||||
if (N->getRawChecksum()) {
|
||||
Record.push_back(N->getRawChecksum()->Kind);
|
||||
Record.push_back(VE.getMetadataOrNullID(N->getRawChecksum()->Value));
|
||||
} else {
|
||||
// Maintain backwards compatibility with the old internal representation of
|
||||
// CSK_None in ChecksumKind by writing nulls here when Checksum is None.
|
||||
Record.push_back(0);
|
||||
Record.push_back(VE.getMetadataOrNullID(nullptr));
|
||||
}
|
||||
|
||||
Stream.EmitRecord(bitc::METADATA_FILE, Record, Abbrev);
|
||||
Record.clear();
|
||||
|
||||
Reference in New Issue
Block a user