@@ -1608,7 +1608,8 @@ void AttributeChecker::checkApplicationMainAttribute(DeclAttribute *attr,
1608
1608
1609
1609
// @XXApplicationMain classes must conform to the XXApplicationDelegate
1610
1610
// protocol.
1611
- auto &C = D->getASTContext ();
1611
+ auto *SF = cast<SourceFile>(CD->getModuleScopeContext ());
1612
+ auto &C = SF->getASTContext ();
1612
1613
1613
1614
auto KitModule = C.getLoadedModule (Id_Kit);
1614
1615
ProtocolDecl *ApplicationDelegateProto = nullptr ;
@@ -1617,7 +1618,7 @@ void AttributeChecker::checkApplicationMainAttribute(DeclAttribute *attr,
1617
1618
namelookup::lookupInModule (KitModule, Id_ApplicationDelegate,
1618
1619
decls, NLKind::QualifiedLookup,
1619
1620
namelookup::ResolutionKind::TypesOnly,
1620
- KitModule );
1621
+ SF );
1621
1622
if (decls.size () == 1 )
1622
1623
ApplicationDelegateProto = dyn_cast<ProtocolDecl>(decls[0 ]);
1623
1624
}
@@ -1637,30 +1638,8 @@ void AttributeChecker::checkApplicationMainAttribute(DeclAttribute *attr,
1637
1638
1638
1639
// Register the class as the main class in the module. If there are multiples
1639
1640
// they will be diagnosed.
1640
- auto *SF = cast<SourceFile>(CD->getModuleScopeContext ());
1641
1641
if (SF->registerMainClass (CD, attr->getLocation ()))
1642
1642
attr->setInvalid ();
1643
-
1644
- // Check that we have the needed symbols in the frameworks.
1645
- auto lookupOptions = defaultUnqualifiedLookupOptions;
1646
- lookupOptions |= NameLookupFlags::KnownPrivate;
1647
- auto lookupMain = TC.lookupUnqualified (KitModule, Id_ApplicationMain,
1648
- SourceLoc (), lookupOptions);
1649
-
1650
- for (const auto &result : lookupMain) {
1651
- TC.validateDecl (result.getValueDecl ());
1652
- }
1653
- auto Foundation = TC.Context .getLoadedModule (C.Id_Foundation );
1654
- if (Foundation) {
1655
- auto lookupString = TC.lookupUnqualified (
1656
- Foundation,
1657
- C.getIdentifier (" NSStringFromClass" ),
1658
- SourceLoc (),
1659
- lookupOptions);
1660
- for (const auto &result : lookupString) {
1661
- TC.validateDecl (result.getValueDecl ());
1662
- }
1663
- }
1664
1643
}
1665
1644
1666
1645
void AttributeChecker::visitNSApplicationMainAttr (NSApplicationMainAttr *attr) {
0 commit comments