[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:
Alex Hoppen
2017-05-05 11:15:18 +01:00
committed by Jordan Rose
parent 6871a76965
commit 1fcac0e4f4
5 changed files with 74 additions and 66 deletions

View File

@@ -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);
}