Change the meaning of a UUID with all zeros for data.
Previously, depending on how you constructed a UUID from data or a StringRef, an input value of all zeros was valid (e.g. setFromData) or not (e.g. setFromOptionalData). Since there was no way to tell which interpretation to use, it was done somewhat inconsistently. This standardizes the meaning of a UUID of all zeros to Not Valid, and removes all the Optional methods and their uses, as well as the static factories that supported them. Differential Revision: https://reviews.llvm.org/D132191
This commit is contained in:
@@ -147,7 +147,7 @@ static UUID GetCoffUUID(llvm::object::COFFObjectFile &coff_obj) {
|
||||
UUID::CvRecordPdb70 info;
|
||||
memcpy(&info.Uuid, pdb_info->PDB70.Signature, sizeof(info.Uuid));
|
||||
info.Age = pdb_info->PDB70.Age;
|
||||
return UUID::fromCvRecord(info);
|
||||
return UUID(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ static UUID GetCoffUUID(llvm::object::COFFObjectFile &coff_obj) {
|
||||
}
|
||||
// Use 4 bytes of crc from the .gnu_debuglink section.
|
||||
llvm::support::ulittle32_t data(gnu_debuglink_crc);
|
||||
return UUID::fromData(&data, sizeof(data));
|
||||
return UUID(&data, sizeof(data));
|
||||
}
|
||||
|
||||
char ObjectFilePECOFF::ID;
|
||||
|
||||
Reference in New Issue
Block a user