The list of decls provided by a file should not include private decls.

Part of rdar://problem/15353101

Swift SVN r22928
This commit is contained in:
Jordan Rose
2014-10-24 22:23:06 +00:00
parent ca6639cf97
commit 241a6277a9
2 changed files with 10 additions and 1 deletions

View File

@@ -79,6 +79,9 @@ func lookUpManyTopLevelNames() {
_ = OtherFileAliasForSecret.constant
}
// NEGATIVE-NOT: privateFunc{{$}}
private func privateFunc() {}
// CHECK-LABEL: {{^member-access:$}}
// CHECK-DAG: V4main10IntWrapper{{$}}
// CHECK-DAG: C4main18ClassFromOtherFile{{$}}

View File

@@ -115,9 +115,15 @@ static bool emitReferenceDependencies(DiagnosticEngine &diags,
case DeclKind::Class:
case DeclKind::Protocol:
case DeclKind::Var:
case DeclKind::Func:
case DeclKind::Func: {
auto *VD = cast<ValueDecl>(D);
if (VD->hasAccessibility() &&
VD->getAccessibility() == Accessibility::Private) {
break;
}
out << "\t" << cast<ValueDecl>(D)->getName() << "\n";
break;
}
case DeclKind::PatternBinding:
case DeclKind::TopLevelCode: