Skip to content

Commit 89619f4

Browse files
authored
Merge pull request swiftlang#78245 from tshortli/revert-silgen-name-public-linkage-6.1
[6.1] SIL: Revert public linkage for `@_silgen_name` forward declarations
2 parents 2285785 + c4c3797 commit 89619f4

File tree

3 files changed

+1
-58
lines changed

3 files changed

+1
-58
lines changed

lib/SIL/IR/SILDeclRef.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,6 @@ SILLinkage SILDeclRef::getDefinitionLinkage() const {
651651
effectiveAccess = std::max(effectiveAccess, AccessLevel::Internal);
652652
}
653653

654-
// Declarations with a @_silgen_name attribute and no body may be forward
655-
// declarations of functions defined in another module. Therefore they must
656-
// always have external (public) linkage, regardless of declared access level.
657-
if (auto afd = getAbstractFunctionDecl()) {
658-
if (!afd->hasBody() && afd->getAttrs().hasAttribute<SILGenNameAttr>())
659-
effectiveAccess = AccessLevel::Public;
660-
}
661-
662654
switch (effectiveAccess) {
663655
case AccessLevel::Private:
664656
case AccessLevel::FilePrivate:

test/IRGen/silgen_name_linkage.swift

Lines changed: 0 additions & 49 deletions
This file was deleted.

test/stdlib/Error.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func throwJazzHandsTyped() throws(SillyError) {
229229
// not available, so pass it through an UnsafeRawPointer.
230230
@available(SwiftStdlib 5.8, *)
231231
@_silgen_name("_swift_setWillThrowHandler")
232-
func setWillThrowHandler(
232+
public func setWillThrowHandler(
233233
_ handler: (@convention(c) (UnsafeRawPointer) -> Void)?
234234
)
235235

0 commit comments

Comments
 (0)