mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST/IDE] Centralize the logic to determine if a symbols is a 'private' stdlib one and hide them more extensively.
-Hide vars that have a private type. -Hide functions that have a parameter with private type or a parameter name with leading underscore. -Minor change in StringUTF16.swift to avoid printing "func generate() -> IndexingGenerator<_StringCore>". rdar://17027294 Swift SVN r18623
This commit is contained in:
@@ -517,12 +517,8 @@ bool PrintAST::shouldPrint(const Decl *D) {
|
||||
if (Options.SkipUnavailable && D->getAttrs().isUnavailable())
|
||||
return false;
|
||||
|
||||
if (Options.SkipLeadingUnderscoreDecls) {
|
||||
if (auto VD = dyn_cast<ValueDecl>(D)) {
|
||||
if (VD->hasName() && VD->getFullName().getBaseName().str().startswith("_"))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (Options.SkipPrivateStdlibDecls && D->isPrivateStdlibDecl())
|
||||
return false;
|
||||
|
||||
if (auto Ext = dyn_cast<ExtensionDecl>(D)) {
|
||||
// If the extension doesn't add protocols or has no members that we should
|
||||
|
||||
Reference in New Issue
Block a user