mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[NFC; Incremental] Rename BasicSourceFileInfo.InterfaceHash"
This commit is contained in:
@@ -98,9 +98,7 @@ struct BasicDeclLocs {
|
||||
|
||||
struct BasicSourceFileInfo {
|
||||
StringRef FilePath;
|
||||
/// Used for completion; factors in hashes from type-bodies in order to be sensitive to changes in
|
||||
/// the intefaces of top-level type members.
|
||||
Fingerprint InterfaceHashIncludingTypeMembers = Fingerprint::ZERO();
|
||||
Fingerprint InterfaceHash = Fingerprint::ZERO();
|
||||
llvm::sys::TimePoint<> LastModified = {};
|
||||
uint64_t FileSize = 0;
|
||||
|
||||
|
||||
@@ -1553,7 +1553,7 @@ Fingerprint ModuleDecl::getFingerprint() const {
|
||||
StableHasher hasher = StableHasher::defaultHasher();
|
||||
SmallVector<Fingerprint, 16> FPs;
|
||||
collectBasicSourceFileInfo([&](const BasicSourceFileInfo &bsfi) {
|
||||
FPs.emplace_back(bsfi.InterfaceHashIncludingTypeMembers);
|
||||
FPs.emplace_back(bsfi.InterfaceHash);
|
||||
});
|
||||
|
||||
// Sort the fingerprints lexicographically so we have a stable hash despite
|
||||
|
||||
@@ -262,10 +262,10 @@ bool BasicSourceFileInfo::populate(const SourceFile *SF) {
|
||||
FileSize = stat->getSize();
|
||||
|
||||
if (SF->hasInterfaceHash()) {
|
||||
InterfaceHashIncludingTypeMembers = SF->getInterfaceHashIncludingTypeMembers();
|
||||
InterfaceHash = SF->getInterfaceHashIncludingTypeMembers();
|
||||
} else {
|
||||
// FIXME: Parse the file with EnableInterfaceHash option.
|
||||
InterfaceHashIncludingTypeMembers = Fingerprint::ZERO();
|
||||
InterfaceHash = Fingerprint::ZERO();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -978,7 +978,7 @@ void ModuleFile::collectBasicSourceFileInfo(
|
||||
while (Cursor < End) {
|
||||
// FilePath (byte offset in 'SourceLocsTextData').
|
||||
auto fileID = endian::readNext<uint32_t, little, unaligned>(Cursor);
|
||||
// InterfaceHashIncludingTypeMembers (fixed length string).
|
||||
// InterfaceHash (fixed length string).
|
||||
auto fpStr = StringRef{reinterpret_cast<const char *>(Cursor),
|
||||
Fingerprint::DIGEST_LENGTH};
|
||||
Cursor += Fingerprint::DIGEST_LENGTH;
|
||||
@@ -995,7 +995,7 @@ void ModuleFile::collectBasicSourceFileInfo(
|
||||
BasicSourceFileInfo info;
|
||||
info.FilePath = filePath;
|
||||
if (auto fingerprint = Fingerprint::fromString(fpStr))
|
||||
info.InterfaceHashIncludingTypeMembers = fingerprint.getValue();
|
||||
info.InterfaceHash = fingerprint.getValue();
|
||||
else {
|
||||
llvm::errs() << "Unconvertable fingerprint '" << fpStr << "'\n";
|
||||
abort();
|
||||
|
||||
@@ -803,7 +803,7 @@ static void emitFileListRecord(llvm::BitstreamWriter &Out,
|
||||
return;
|
||||
|
||||
auto fileID = FWriter.getTextOffset(absolutePath);
|
||||
auto fingerprintStr = info.InterfaceHashIncludingTypeMembers.getRawValue();
|
||||
auto fingerprintStr = info.InterfaceHash.getRawValue();
|
||||
auto timestamp = std::chrono::duration_cast<std::chrono::nanoseconds>(
|
||||
info.LastModified.time_since_epoch())
|
||||
.count();
|
||||
@@ -812,7 +812,7 @@ static void emitFileListRecord(llvm::BitstreamWriter &Out,
|
||||
endian::Writer writer(out, little);
|
||||
// FilePath.
|
||||
writer.write<uint32_t>(fileID);
|
||||
// InterfaceHashIncludingTypeMembers (fixed length string).
|
||||
// InterfaceHash (fixed length string).
|
||||
assert(fingerprintStr.size() == Fingerprint::DIGEST_LENGTH);
|
||||
out << fingerprintStr;
|
||||
// LastModified (nanoseconds since epoch).
|
||||
|
||||
@@ -2518,7 +2518,7 @@ static void printModuleMetadata(ModuleDecl *MD) {
|
||||
});
|
||||
MD->collectBasicSourceFileInfo([&](const BasicSourceFileInfo &info) {
|
||||
OS << "filepath=" << info.FilePath << "; ";
|
||||
OS << "hash=" << info.InterfaceHashIncludingTypeMembers.getRawValue() << "; ";
|
||||
OS << "hash=" << info.InterfaceHash.getRawValue() << "; ";
|
||||
OS << "mtime=" << info.LastModified << "; ";
|
||||
OS << "size=" << info.FileSize;
|
||||
OS << "\n";
|
||||
|
||||
Reference in New Issue
Block a user