diff --git a/include/swift/Localization/LocalizationFormat.h b/include/swift/Localization/LocalizationFormat.h index 78c6937e03ea6..38e5e8c04cb61 100644 --- a/include/swift/Localization/LocalizationFormat.h +++ b/include/swift/Localization/LocalizationFormat.h @@ -71,7 +71,7 @@ class LocalizationWriterInfo { using hash_value_type = uint32_t; using offset_type = uint32_t; - hash_value_type ComputeHash(key_type_ref key) { return llvm::hash_code(key); } + hash_value_type ComputeHash(key_type_ref key) { return key; } std::pair EmitKeyDataLength(llvm::raw_ostream &out, key_type_ref key, @@ -113,9 +113,7 @@ class LocalizationReaderInfo { return lhs == rhs; } - hash_value_type ComputeHash(internal_key_type key) { - return llvm::hash_code(key); - } + hash_value_type ComputeHash(internal_key_type key) { return key; } static std::pair ReadKeyDataLength(const unsigned char *&data) { diff --git a/lib/ClangImporter/SwiftLookupTable.cpp b/lib/ClangImporter/SwiftLookupTable.cpp index 78f169f3cdb8c..62b636ece94e3 100644 --- a/lib/ClangImporter/SwiftLookupTable.cpp +++ b/lib/ClangImporter/SwiftLookupTable.cpp @@ -1116,7 +1116,7 @@ namespace { } hash_value_type ComputeHash(key_type_ref key) { - return llvm::DenseMapInfo::getHashValue(key); + return static_cast(key.Kind) + llvm::djbHash(key.Name); } std::pair EmitKeyDataLength(raw_ostream &out, @@ -1223,7 +1223,8 @@ namespace { } hash_value_type ComputeHash(key_type_ref key) { - return static_cast(key.first) + llvm::djbHash(key.second); + return static_cast(key.first) + + llvm::djbHash(key.second); } std::pair EmitKeyDataLength(raw_ostream &out, @@ -1414,7 +1415,7 @@ namespace { } hash_value_type ComputeHash(internal_key_type key) { - return llvm::DenseMapInfo::getHashValue(key); + return static_cast(key.Kind) + llvm::djbHash(key.Name); } static bool EqualKey(internal_key_type lhs, internal_key_type rhs) { @@ -1502,7 +1503,7 @@ namespace { } hash_value_type ComputeHash(internal_key_type key) { - return static_cast(key.first) + llvm::djbHash(key.second); + return static_cast(key.first) + llvm::djbHash(key.second); } static bool EqualKey(internal_key_type lhs, internal_key_type rhs) { diff --git a/lib/ClangImporter/SwiftLookupTable.h b/lib/ClangImporter/SwiftLookupTable.h index a10fe9e30163e..22e827ae941c1 100644 --- a/lib/ClangImporter/SwiftLookupTable.h +++ b/lib/ClangImporter/SwiftLookupTable.h @@ -282,8 +282,7 @@ const uint16_t SWIFT_LOOKUP_TABLE_VERSION_MAJOR = 1; /// Lookup table minor version number. /// /// When the format changes IN ANY WAY, this number should be incremented. -const uint16_t SWIFT_LOOKUP_TABLE_VERSION_MINOR = 18; // Unsafe C++ method renaming. - +const uint16_t SWIFT_LOOKUP_TABLE_VERSION_MINOR = 19; // hash functions /// A lookup table that maps Swift names to the set of Clang /// declarations with that particular name. diff --git a/lib/Serialization/ModuleFileCoreTableInfo.h b/lib/Serialization/ModuleFileCoreTableInfo.h index 659cfd0344b1a..5b09634c8b852 100644 --- a/lib/Serialization/ModuleFileCoreTableInfo.h +++ b/lib/Serialization/ModuleFileCoreTableInfo.h @@ -330,7 +330,7 @@ class ModuleFileSharedCore::DeclMembersTableInfo { } hash_value_type ComputeHash(internal_key_type key) { - return llvm::hash_value(key); + return key; } static bool EqualKey(internal_key_type lhs, internal_key_type rhs) { @@ -580,7 +580,7 @@ class ModuleFileSharedCore::DeclFingerprintsTableInfo { internal_key_type GetInternalKey(external_key_type ID) { return ID; } hash_value_type ComputeHash(internal_key_type key) { - return llvm::hash_value(key); + return key; } static bool EqualKey(internal_key_type lhs, internal_key_type rhs) { diff --git a/lib/Serialization/ModuleFormat.h b/lib/Serialization/ModuleFormat.h index d37c90ad35d39..1b0cb2951455a 100644 --- a/lib/Serialization/ModuleFormat.h +++ b/lib/Serialization/ModuleFormat.h @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0; /// describe what change you made. The content of this comment isn't important; /// it just ensures a conflict if two people change the module format. /// Don't worry about adhering to the 80-column limit for this line. -const uint16_t SWIFTMODULE_VERSION_MINOR = 882; // CXXStdlibKind +const uint16_t SWIFTMODULE_VERSION_MINOR = 883; // hash functions /// A standard hash seed used for all string hashes in a serialized module. /// diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index 426e18150403e..88f44c3710038 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -414,7 +414,7 @@ namespace { using offset_type = unsigned; hash_value_type ComputeHash(key_type_ref key) { - return llvm::hash_value(static_cast(key)); + return key; } std::pair EmitKeyDataLength(raw_ostream &out, @@ -459,7 +459,7 @@ namespace { using offset_type = unsigned; hash_value_type ComputeHash(key_type_ref key) { - return llvm::hash_value(static_cast(key)); + return key; } std::pair