@@ -1769,24 +1769,6 @@ bool ShouldPrintChecker::shouldPrint(const Pattern *P,
17691769 return ShouldPrint;
17701770}
17711771
1772- bool isNonSendableExtension (const Decl *D) {
1773- ASTContext &ctx = D->getASTContext ();
1774-
1775- const ExtensionDecl *ED = dyn_cast<ExtensionDecl>(D);
1776- if (!ED || !ED->getAttrs ().isUnavailable (ctx))
1777- return false ;
1778-
1779- auto nonSendable =
1780- ED->getExtendedNominal ()->getAttrs ().getEffectiveSendableAttr ();
1781- if (!isa_and_nonnull<NonSendableAttr>(nonSendable))
1782- return false ;
1783-
1784- // GetImplicitSendableRequest::evaluate() creates its extension with the
1785- // attribute's AtLoc, so this is a good way to quickly check if the extension
1786- // was synthesized for an '@_nonSendable' attribute.
1787- return ED->getLocFromSource () == nonSendable->AtLoc ;
1788- }
1789-
17901772bool ShouldPrintChecker::shouldPrint (const Decl *D,
17911773 const PrintOptions &Options) {
17921774 #if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
@@ -1809,19 +1791,16 @@ bool ShouldPrintChecker::shouldPrint(const Decl *D,
18091791 return false ;
18101792 }
18111793
1812- // Optionally skip these checks for extensions synthesized for '@_nonSendable'
1813- if (!Options.AlwaysPrintNonSendableExtensions || !isNonSendableExtension (D)) {
1814- if (Options.SkipImplicit && D->isImplicit ()) {
1815- const auto &IgnoreList = Options.TreatAsExplicitDeclList ;
1816- if (!llvm::is_contained (IgnoreList, D))
1794+ if (Options.SkipImplicit && D->isImplicit ()) {
1795+ const auto &IgnoreList = Options.TreatAsExplicitDeclList ;
1796+ if (std::find (IgnoreList.begin (), IgnoreList.end (), D) == IgnoreList.end ())
18171797 return false ;
1818- }
1819-
1820- if (Options.SkipUnavailable &&
1821- D->getAttrs ().isUnavailable (D->getASTContext ()))
1822- return false ;
18231798 }
18241799
1800+ if (Options.SkipUnavailable &&
1801+ D->getAttrs ().isUnavailable (D->getASTContext ()))
1802+ return false ;
1803+
18251804 if (Options.ExplodeEnumCaseDecls ) {
18261805 if (isa<EnumElementDecl>(D))
18271806 return true ;
@@ -5927,7 +5906,6 @@ swift::getInheritedForPrinting(
59275906 // Collect synthesized conformances.
59285907 auto &ctx = decl->getASTContext ();
59295908 llvm::SetVector<ProtocolDecl *> protocols;
5930- llvm::TinyPtrVector<ProtocolDecl *> uncheckedProtocols;
59315909 for (auto attr : decl->getAttrs ().getAttributes <SynthesizedProtocolAttr>()) {
59325910 if (auto *proto = ctx.getProtocol (attr->getProtocolKind ())) {
59335911 // The SerialExecutor conformance is only synthesized on the root
@@ -5940,14 +5918,11 @@ swift::getInheritedForPrinting(
59405918 cast<EnumDecl>(decl)->hasRawType ())
59415919 continue ;
59425920 protocols.insert (proto);
5943- if (attr->isUnchecked ())
5944- uncheckedProtocols.push_back (proto);
59455921 }
59465922 }
59475923
59485924 for (size_t i = 0 ; i < protocols.size (); i++) {
59495925 auto proto = protocols[i];
5950- bool isUnchecked = llvm::is_contained (uncheckedProtocols, proto);
59515926
59525927 if (!options.shouldPrint (proto)) {
59535928 // If private stdlib protocols are skipped and this is a private stdlib
@@ -5958,14 +5933,12 @@ swift::getInheritedForPrinting(
59585933 proto->isPrivateStdlibDecl (!options.SkipUnderscoredStdlibProtocols )) {
59595934 auto inheritedProtocols = proto->getInheritedProtocols ();
59605935 protocols.insert (inheritedProtocols.begin (), inheritedProtocols.end ());
5961- if (isUnchecked)
5962- copy (inheritedProtocols, std::back_inserter (uncheckedProtocols));
59635936 }
59645937 continue ;
59655938 }
59665939
59675940 Results.push_back ({TypeLoc::withoutLoc (proto->getDeclaredInterfaceType ()),
5968- isUnchecked});
5941+ /* isUnchecked= */ false });
59695942 }
59705943}
59715944
0 commit comments