Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.1] SIL: Revert public linkage for @_silgen_name forward declarations #78245

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/SIL/IR/SILDeclRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,14 +651,6 @@ SILLinkage SILDeclRef::getDefinitionLinkage() const {
effectiveAccess = std::max(effectiveAccess, AccessLevel::Internal);
}

// Declarations with a @_silgen_name attribute and no body may be forward
// declarations of functions defined in another module. Therefore they must
// always have external (public) linkage, regardless of declared access level.
if (auto afd = getAbstractFunctionDecl()) {
if (!afd->hasBody() && afd->getAttrs().hasAttribute<SILGenNameAttr>())
effectiveAccess = AccessLevel::Public;
}

switch (effectiveAccess) {
case AccessLevel::Private:
case AccessLevel::FilePrivate:
Expand Down
49 changes: 0 additions & 49 deletions test/IRGen/silgen_name_linkage.swift

This file was deleted.

2 changes: 1 addition & 1 deletion test/stdlib/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func throwJazzHandsTyped() throws(SillyError) {
// not available, so pass it through an UnsafeRawPointer.
@available(SwiftStdlib 5.8, *)
@_silgen_name("_swift_setWillThrowHandler")
func setWillThrowHandler(
public func setWillThrowHandler(
_ handler: (@convention(c) (UnsafeRawPointer) -> Void)?
)

Expand Down