Merge pull request #17729 from DougGregor/minimize-override-checking

[Type checker] Minimize checking needed to compute the set of overridden declarations
This commit is contained in:
Doug Gregor
2018-07-05 06:38:46 -07:00
committed by GitHub
10 changed files with 222 additions and 115 deletions

View File

@@ -2412,6 +2412,10 @@ static void configureDesignatedInitAttributes(TypeChecker &tc,
ctor, {classDecl, superclassCtor}, ctx);
}
// Wire up the overrides.
ctor->getAttrs().add(new (ctx) OverrideAttr(/*IsImplicit=*/true));
ctor->setOverriddenDecl(superclassCtor);
if (superclassCtor->isObjC()) {
// Inherit the @objc name from the superclass initializer, if it
// has one.
@@ -2430,10 +2434,6 @@ static void configureDesignatedInitAttributes(TypeChecker &tc,
ctor->getAttrs().add(new (ctx) RequiredAttr(/*IsImplicit=*/true));
if (superclassCtor->isDynamic())
ctor->getAttrs().add(new (ctx) DynamicAttr(/*IsImplicit*/true));
// Wire up the overrides.
ctor->getAttrs().add(new (ctx) OverrideAttr(/*IsImplicit=*/true));
ctor->setOverriddenDecl(superclassCtor);
}
ConstructorDecl *