Skip to content

Commit 34223bc

Browse files
authored
Merge pull request #36162 from apple/revert-36133-module-print-2
Revert "[NFC; Incremental] Rename BasicSourceFileInfo.InterfaceHash"
2 parents 62a5d1c + 6e034ca commit 34223bc

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

include/swift/AST/RawComment.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ struct BasicDeclLocs {
9898

9999
struct BasicSourceFileInfo {
100100
StringRef FilePath;
101-
/// Used for completion; factors in hashes from type-bodies in order to be sensitive to changes in
102-
/// the intefaces of top-level type members.
103-
Fingerprint InterfaceHashIncludingTypeMembers = Fingerprint::ZERO();
101+
Fingerprint InterfaceHash = Fingerprint::ZERO();
104102
llvm::sys::TimePoint<> LastModified = {};
105103
uint64_t FileSize = 0;
106104

lib/AST/Module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ Fingerprint ModuleDecl::getFingerprint() const {
15531553
StableHasher hasher = StableHasher::defaultHasher();
15541554
SmallVector<Fingerprint, 16> FPs;
15551555
collectBasicSourceFileInfo([&](const BasicSourceFileInfo &bsfi) {
1556-
FPs.emplace_back(bsfi.InterfaceHashIncludingTypeMembers);
1556+
FPs.emplace_back(bsfi.InterfaceHash);
15571557
});
15581558

15591559
// Sort the fingerprints lexicographically so we have a stable hash despite

lib/AST/RawComment.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ bool BasicSourceFileInfo::populate(const SourceFile *SF) {
262262
FileSize = stat->getSize();
263263

264264
if (SF->hasInterfaceHash()) {
265-
InterfaceHashIncludingTypeMembers = SF->getInterfaceHashIncludingTypeMembers();
265+
InterfaceHash = SF->getInterfaceHashIncludingTypeMembers();
266266
} else {
267267
// FIXME: Parse the file with EnableInterfaceHash option.
268-
InterfaceHashIncludingTypeMembers = Fingerprint::ZERO();
268+
InterfaceHash = Fingerprint::ZERO();
269269
}
270270

271271
return false;

lib/Serialization/ModuleFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ void ModuleFile::collectBasicSourceFileInfo(
978978
while (Cursor < End) {
979979
// FilePath (byte offset in 'SourceLocsTextData').
980980
auto fileID = endian::readNext<uint32_t, little, unaligned>(Cursor);
981-
// InterfaceHashIncludingTypeMembers (fixed length string).
981+
// InterfaceHash (fixed length string).
982982
auto fpStr = StringRef{reinterpret_cast<const char *>(Cursor),
983983
Fingerprint::DIGEST_LENGTH};
984984
Cursor += Fingerprint::DIGEST_LENGTH;
@@ -995,7 +995,7 @@ void ModuleFile::collectBasicSourceFileInfo(
995995
BasicSourceFileInfo info;
996996
info.FilePath = filePath;
997997
if (auto fingerprint = Fingerprint::fromString(fpStr))
998-
info.InterfaceHashIncludingTypeMembers = fingerprint.getValue();
998+
info.InterfaceHash = fingerprint.getValue();
999999
else {
10001000
llvm::errs() << "Unconvertable fingerprint '" << fpStr << "'\n";
10011001
abort();

lib/Serialization/SerializeDoc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static void emitFileListRecord(llvm::BitstreamWriter &Out,
803803
return;
804804

805805
auto fileID = FWriter.getTextOffset(absolutePath);
806-
auto fingerprintStr = info.InterfaceHashIncludingTypeMembers.getRawValue();
806+
auto fingerprintStr = info.InterfaceHash.getRawValue();
807807
auto timestamp = std::chrono::duration_cast<std::chrono::nanoseconds>(
808808
info.LastModified.time_since_epoch())
809809
.count();
@@ -812,7 +812,7 @@ static void emitFileListRecord(llvm::BitstreamWriter &Out,
812812
endian::Writer writer(out, little);
813813
// FilePath.
814814
writer.write<uint32_t>(fileID);
815-
// InterfaceHashIncludingTypeMembers (fixed length string).
815+
// InterfaceHash (fixed length string).
816816
assert(fingerprintStr.size() == Fingerprint::DIGEST_LENGTH);
817817
out << fingerprintStr;
818818
// LastModified (nanoseconds since epoch).

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,7 +2518,7 @@ static void printModuleMetadata(ModuleDecl *MD) {
25182518
});
25192519
MD->collectBasicSourceFileInfo([&](const BasicSourceFileInfo &info) {
25202520
OS << "filepath=" << info.FilePath << "; ";
2521-
OS << "hash=" << info.InterfaceHashIncludingTypeMembers.getRawValue() << "; ";
2521+
OS << "hash=" << info.InterfaceHash.getRawValue() << "; ";
25222522
OS << "mtime=" << info.LastModified << "; ";
25232523
OS << "size=" << info.FileSize;
25242524
OS << "\n";

0 commit comments

Comments
 (0)