[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

@@ -66,7 +66,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
/// Returns true if \p paramTy has any constraints other than being
/// class-bound ("conforms to" AnyObject).
static bool isConstrained(GenericSignature *sig,
static bool isConstrained(GenericSignature sig,
GenericTypeParamType *paramTy) {
if (sig->getSuperclassBound(paramTy))
return true;
@@ -83,7 +83,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
NeedsDefinition = false;
bool isObjCGeneric = decl->hasClangNode();
auto *sig = decl->getGenericSignature();
auto sig = decl->getGenericSignature();
for_each(boundGeneric->getGenericArgs(),
sig->getInnermostGenericParams(),
@@ -587,4 +587,4 @@ swift::printModuleContentsAsObjC(raw_ostream &os,
llvm::SmallPtrSetImpl<ImportModuleTy> &imports,
ModuleDecl &M, AccessLevel minRequiredAccess) {
ModuleWriter(os, imports, M, minRequiredAccess).write();
}
}