[AST] Add ExtensionDecl::getExtendedNominal().

Introduce ExtensionDecl::getExtendedNominal() to provide the nominal
type declaration that the extension declaration extends. Move most
of the existing callers of the callers to getExtendedType() over to
getExtendedNominal(), because they don’t need the full type information.

ExtensionDecl::getExtendedNominal() is itself not very interesting yet,
because it depends on getExtendedType().
This commit is contained in:
Doug Gregor
2018-07-31 14:53:21 -07:00
parent 285b337cf5
commit bd5f5d80e4
30 changed files with 129 additions and 175 deletions

View File

@@ -159,7 +159,7 @@ UIdent UIdentVisitor::visitParamDecl(const ParamDecl *D) {
UIdent UIdentVisitor::visitExtensionDecl(const ExtensionDecl *D) {
assert(!IsRef && "reference to an extension ?");
if (NominalTypeDecl *NTD = D->getExtendedType()->getAnyNominal()) {
if (NominalTypeDecl *NTD = D->getExtendedNominal()) {
if (isa<StructDecl>(NTD))
return KindDeclExtensionStruct;
if (isa<ClassDecl>(NTD))