Skip to content

Commit

Permalink
Merge pull request swiftlang#78245 from tshortli/revert-silgen-name-p…
Browse files Browse the repository at this point in the history
…ublic-linkage-6.1

[6.1] SIL: Revert public linkage for `@_silgen_name` forward declarations
  • Loading branch information
tshortli authored Dec 17, 2024
2 parents 2285785 + c4c3797 commit 89619f4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 58 deletions.
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

0 comments on commit 89619f4

Please sign in to comment.