Skip to content

Commit 57e11b8

Browse files
committed
Delete skipAccessCheckIfInterface as no longer used
1 parent d570d41 commit 57e11b8

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,25 +2742,6 @@ class ValueDecl : public Decl {
27422742
/// \c \@usableFromInline, \c \@inlinalbe, and \c \@_alwaysEmitIntoClient
27432743
bool isUsableFromInline() const;
27442744

2745-
/// Returns \c true if this value decl needs a special case handling for an
2746-
/// interface file.
2747-
///
2748-
/// One such case is a reference of an inlinable decl with a `package` access level
2749-
/// in an interface file as follows: Package decls are only printed in interface files if
2750-
/// they are inlinable (as defined in \c isUsableFromInline). They could be
2751-
/// referenced by a module outside of its defining module that belong to the same
2752-
/// package determined by the `package-name` flag. However, the flag is only in
2753-
/// .swiftmodule and .private.swiftinterface, thus type checking references of inlinable
2754-
/// package symbols in public interfaces fails due to the missing flag.
2755-
/// Instead of adding the package-name flag to the public interfaces, which
2756-
/// could raise a security concern, we grant access to such cases.
2757-
///
2758-
/// \sa useDC The use site where this value decl is referenced.
2759-
/// \sa useAcl The access level of its use site.
2760-
/// \sa declScope The access scope of this decl site.
2761-
bool skipAccessCheckIfInterface(const DeclContext *useDC, AccessLevel useAcl,
2762-
AccessScope declScope) const;
2763-
27642745
/// Returns \c true if this declaration is *not* intended to be used directly
27652746
/// by application developers despite the visibility.
27662747
bool shouldHideFromEditor() const;

lib/AST/Decl.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,17 +3952,6 @@ bool ValueDecl::isUsableFromInline() const {
39523952
return false;
39533953
}
39543954

3955-
bool ValueDecl::skipAccessCheckIfInterface(const DeclContext *useDC,
3956-
AccessLevel useAcl,
3957-
AccessScope declScope) const {
3958-
if (!useDC || useAcl != AccessLevel::Package || !declScope.isPackage() ||
3959-
!isUsableFromInline() ||
3960-
getDeclContext()->getParentModule() == useDC->getParentModule())
3961-
return false;
3962-
auto useSF = useDC->getParentSourceFile();
3963-
return useSF && useSF->Kind == SourceFileKind::Interface;
3964-
}
3965-
39663955
bool ValueDecl::shouldHideFromEditor() const {
39673956
// Hide private stdlib declarations.
39683957
if (isPrivateStdlibDecl(/*treatNonBuiltinProtocolsAsPublic*/ false) ||

0 commit comments

Comments
 (0)