[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:
Argyrios Kyrtzidis
2014-05-25 03:49:02 +00:00
parent 1efc2d9fae
commit 95bd9e1d28
10 changed files with 114 additions and 34 deletions

View File

@@ -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