You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit enables the ABIAttribute feature in the standard library build and replaces (nearly) every instance of `@_silgen_name(<mangled Swift name>)` in stdlib/public with an `@abi` attribute.
Copy file name to clipboardExpand all lines: docs/StandardLibraryProgrammersManual.md
+2
Original file line number
Diff line number
Diff line change
@@ -455,6 +455,8 @@ This attribute specifies the name that a declaration will have at link time. It
455
455
1. To specify the symbol name of a Swift function so that it can be called from Swift-aware C. Such functions have bodies.
456
456
2. To provide a Swift declaration which really represents a C declaration. Such functions do not have bodies.
457
457
458
+
In the past it was sometimes used for ABI backwards compatibility hacks, but `@abi` does this job better.
459
+
458
460
##### Using `@_silgen_name` to call Swift from Swift-aware C
459
461
460
462
Rather than hard-code Swift mangling into C code, `@_silgen_name` is used to provide a stable and known symbol name for linking. Note that C code still must understand and use the Swift calling convention (available in swift-clang) for such Swift functions (if they use Swift's CC). Example:
0 commit comments