[NFC] Adopt TypeBase-isms for GenericSignature

Structurally prevent a number of common anti-patterns involving generic
signatures by separating the interface into GenericSignature and the
implementation into GenericSignatureBase.  In particular, this allows
the comparison operators to be deleted which forces callers to
canonicalize the signature or ask to compare pointers explicitly.
This commit is contained in:
Robert Widmann
2019-09-29 23:06:49 -07:00
parent d1c87f3c93
commit 5a8d0744c3
104 changed files with 780 additions and 631 deletions

View File

@@ -197,7 +197,7 @@ class Serializer : public SerializerBase {
index_block::LOCAL_DECL_CONTEXT_OFFSETS>
LocalDeclContextsToSerialize;
ASTBlockRecordKeeper<const GenericSignature *, GenericSignatureID,
ASTBlockRecordKeeper<GenericSignature, GenericSignatureID,
index_block::GENERIC_SIGNATURE_OFFSETS>
GenericSignaturesToSerialize;
@@ -314,7 +314,7 @@ private:
void writeASTBlockEntity(Type ty);
/// Writes a generic signature.
void writeASTBlockEntity(const GenericSignature *sig);
void writeASTBlockEntity(GenericSignature sig);
/// Writes a substitution map.
void writeASTBlockEntity(const SubstitutionMap substitutions);
@@ -427,7 +427,7 @@ public:
/// Records the use of the given generic signature.
///
/// The GenericSignature will be scheduled for serialization if necessary.
GenericSignatureID addGenericSignatureRef(const GenericSignature *sig);
GenericSignatureID addGenericSignatureRef(GenericSignature sig);
/// Records the use of the given substitution map.
///