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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user