File tree Expand file tree Collapse file tree 4 files changed +1
-34
lines changed Expand file tree Collapse file tree 4 files changed +1
-34
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,6 @@ class ASTPrinter {
87
87
PendingDeclLocCallback = D;
88
88
}
89
89
90
- static bool isInternalProtocol (const Decl *D);
91
-
92
90
// / To sanitize a malformatted utf8 string to a well-formatted one.
93
91
static std::string sanitizeUtf8 (StringRef Text);
94
92
Original file line number Diff line number Diff line change @@ -144,10 +144,6 @@ struct PrintOptions {
144
144
// / Whether we are printing part of SIL body.
145
145
bool PrintInSILBody = false ;
146
146
147
- // / Wheter we print the internal protocols in stdlib whose names start with no
148
- // / '_'. rdar://21515803
149
- bool PrintInternalStdlibProtocols = false ;
150
-
151
147
enum class ArgAndParamPrintingMode {
152
148
ArgumentOnly,
153
149
MatchSource,
@@ -202,7 +198,6 @@ struct PrintOptions {
202
198
result.PrintFunctionRepresentationAttrs = false ;
203
199
result.PrintOverrideKeyword = false ;
204
200
result.AccessibilityFilter = Accessibility::Public;
205
- result.PrintInternalStdlibProtocols = true ;
206
201
return result;
207
202
}
208
203
@@ -217,7 +212,6 @@ struct PrintOptions {
217
212
result.PrintDocumentationComments = false ;
218
213
result.PrintRegularClangComments = false ;
219
214
result.PrintAccessibility = false ;
220
- result.PrintInternalStdlibProtocols = true ;
221
215
return result;
222
216
}
223
217
Original file line number Diff line number Diff line change 43
43
44
44
using namespace swift ;
45
45
46
- bool ASTPrinter::isInternalProtocol (const Decl *D) {
47
- if (auto Pro = dyn_cast<ProtocolDecl>(D)) {
48
- if (!Pro->getNameStr ().startswith (" _" ) &&
49
- Pro->getFormalAccess () == Accessibility::Internal) {
50
- return true ;
51
- }
52
- }
53
- return false ;
54
- }
55
-
56
46
std::string ASTPrinter::sanitizeUtf8 (StringRef Text) {
57
47
llvm::SmallString<256 > Builder;
58
48
Builder.reserve (Text.size ());
@@ -627,12 +617,6 @@ void PrintAST::printPatternType(const Pattern *P) {
627
617
}
628
618
629
619
bool PrintAST::shouldPrint (const Decl *D) {
630
- if (D->getModuleContext ()->isStdlibModule () &&
631
- ASTPrinter::isInternalProtocol (D) &&
632
- Options.PrintInternalStdlibProtocols ) {
633
- return true ;
634
- }
635
-
636
620
if (Options.SkipDeinit && isa<DestructorDecl>(D)) {
637
621
return false ;
638
622
}
@@ -1346,10 +1330,7 @@ void PrintAST::visitProtocolDecl(ProtocolDecl *decl) {
1346
1330
1347
1331
printInherited (decl, explicitClass);
1348
1332
if (Options.TypeDefinitions ) {
1349
- if (!Options.PrintInternalStdlibProtocols ||
1350
- !ASTPrinter::isInternalProtocol (decl) ||
1351
- !decl->getModuleContext ()->isStdlibModule ())
1352
- printMembers (decl->getMembers ());
1333
+ printMembers (decl->getMembers ());
1353
1334
}
1354
1335
}
1355
1336
Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ void swift::ide::printSubmoduleInterface(
141
141
const PrintOptions &Options) {
142
142
auto AdjustedOptions = Options;
143
143
adjustPrintOptions (AdjustedOptions);
144
- auto PrintInternalProtocol = Options.PrintInternalStdlibProtocols &&
145
- M->isStdlibModule ();
146
144
147
145
SmallVector<Decl *, 1 > Decls;
148
146
M->getDisplayDecls (Decls);
@@ -210,10 +208,6 @@ void swift::ide::printSubmoduleInterface(
210
208
if (Options.SkipUnavailable && D->getAttrs ().isUnavailable (SwiftContext))
211
209
continue ;
212
210
213
- if (PrintInternalProtocol && ASTPrinter::isInternalProtocol (D)) {
214
- SwiftDecls.push_back (D);
215
- }
216
-
217
211
// Skip declarations that are not accessible.
218
212
if (auto *VD = dyn_cast<ValueDecl>(D)) {
219
213
if (Options.AccessibilityFilter > Accessibility::Private &&
You can’t perform that action at this time.
0 commit comments