[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

@@ -270,7 +270,7 @@ SkipUnavailable("skip-unavailable",
llvm::cl::init(false));
static llvm::cl::opt<bool>
SkipLeadingUnderscoreDecls("skip-leading-underscore-decls",
SkipPrivateStdlibDecls("skip-private-stdlib-decls",
llvm::cl::desc("Don't print declarations that start with '_'"),
llvm::cl::init(false));
@@ -1013,7 +1013,7 @@ static int doPrintModules(const CompilerInvocation &InitInvok,
bool PrintImplicitAttrs,
bool PrintUnavailableDecls,
bool PrintRegularComments,
bool PrintLeadingUnderscoreDecls) {
bool PrintPrivateStdlibDecls) {
CompilerInvocation Invocation(InitInvok);
CompilerInstance CI;
@@ -1037,7 +1037,7 @@ static int doPrintModules(const CompilerInvocation &InitInvok,
Options.SynthesizeSugarOnTypes = SynthesizeSugarOnTypes;
Options.PrintImplicitAttrs = PrintImplicitAttrs;
Options.PrintRegularClangComments = PrintRegularComments;
Options.SkipLeadingUnderscoreDecls = !PrintLeadingUnderscoreDecls;
Options.SkipPrivateStdlibDecls = !PrintPrivateStdlibDecls;
Options.SkipUnavailable = !PrintUnavailableDecls;
std::unique_ptr<ASTPrinter> Printer;
@@ -1692,7 +1692,7 @@ int main(int argc, char *argv[]) {
options::PrintImplicitAttrs,
!options::SkipUnavailable,
options::PrintRegularComments,
!options::SkipLeadingUnderscoreDecls);
!options::SkipPrivateStdlibDecls);
break;
}