mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Preparations for removal of getName on ValueDecl
With the introduction of special decl names, `Identifier getName()` on `ValueDecl` will be removed and pushed down to nominal declarations whose name is guaranteed not to be special. Prepare for this by calling to `DeclBaseName getBaseName()` instead where appropriate.
This commit is contained in:
@@ -314,13 +314,14 @@ namespace {
|
||||
class ModuleFile::DeclTableInfo {
|
||||
public:
|
||||
using internal_key_type = StringRef;
|
||||
using external_key_type = Identifier;
|
||||
using external_key_type = DeclBaseName;
|
||||
using data_type = SmallVector<std::pair<uint8_t, DeclID>, 8>;
|
||||
using hash_value_type = uint32_t;
|
||||
using offset_type = unsigned;
|
||||
|
||||
internal_key_type GetInternalKey(external_key_type ID) {
|
||||
return ID.str();
|
||||
// TODO: Handle special names
|
||||
return ID.getIdentifier().str();
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
@@ -338,6 +339,7 @@ public:
|
||||
}
|
||||
|
||||
static internal_key_type ReadKey(const uint8_t *data, unsigned length) {
|
||||
// TODO: Handle special names
|
||||
return StringRef(reinterpret_cast<const char *>(data), length);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user