Skip to content

Conversation

@slavapestov
Copy link
Contributor

Fixes rdar://problem/36429556, rdar://problem/33767513, https://bugs.swift.org/browse/SR-5647.

@slavapestov
Copy link
Contributor Author

@aschwaighofer @eeckstein @airspeedswift This can be used to implement "always emit into client" semantics for ordinary functions as well, either @_transparent (as Arnold and Erik proposed) or a new secret attribute for use in the stdlib (Ben's request).

@slavapestov slavapestov force-pushed the public-non-abi-linkage branch from 533dc0a to e259c8e Compare January 14, 2018 08:18
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov requested a review from jckarter January 14, 2018 08:33
This is going to be used for "always emit into client" functions,
such as default argument generators and stored property
initializers.

- In dead function elimination, these functions behave identically to
  public functions, serving as "anchors" for the mark-and-sweep
  analysis.

- There is no external variant of this linkage, because external
  declarations can use HiddenExternal linkage -- the definition should
  always be emitted by another translation unit in the same Swift
  module.

- When deserialized, they receive shared linkage, because we want the
  linker to coalesce multiple copies of the same deserialized
  definition if it was deserialized from multiple translation units
  in the same Swift module.

- When IRGen emits a definition with this linkage, it receives the
  same LLVM-level linkage as a hidden definition, ensuring it does not
  have a public entry point.
Previously we were creating private [serialized] functions here, which
do not deserialize properly. This was only exposed by making default
argument generators PublicNonABI also.
Also, bail out before emitting any default argument generators in Swift 4
mode. This is NFC, because we already check the linkage of the SILDeclRef
and skip it if its not public. But adding the check explicitly here
serves as a reminder that this entire code block can be deleted if we
ever decide to kill off Swift 3 compatibility.
…ixed_layout types

Fixes <rdar://problem/36429556>.
@slavapestov slavapestov force-pushed the public-non-abi-linkage branch 2 times, most recently from 292a4d7 to eeb6e21 Compare January 15, 2018 07:11
@slavapestov
Copy link
Contributor Author

swiftlang/swift-corelibs-foundation#1394
@swift-ci Please smoke test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant