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
SE-0492: Stabilize @_section/@_used into @section/@used
Removes the underscored prefixes from the @_section and @_used attributes, making them public as @section and @used respectively. The SymbolLinkageMarkers experimental feature has been removed as these attributes are now part of the standard language. Implemented expression syntactic checking rules per SE-0492.
Major parts:
- Renamed @_section to @section and @_used to @used
- Removed the SymbolLinkageMarkers experimental feature
- Added parsing support for the old underscored names with deprecation warnings
- Updated all tests and examples to use the new attribute names
- Added syntactic validation for @section to align with SE-0492 (reusing the legality checker by @artemcm)
- Changed @DebugDescription macro to explicitly use a tuple type instead of type inferring it, to comply with the expression syntax rules
- Added a testcase for the various allowed and disallowed syntactic forms, `test/ConstValues/SectionSyntactic.swift`.
Copy file name to clipboardExpand all lines: docs/ReferenceGuides/UnderscoredAttributes.md
-12Lines changed: 0 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1117,12 +1117,6 @@ if it is never explicitly bound using a typed pointer method like
1117
1117
bound, it must only be used with compatible typed memory accesses for as long
1118
1118
as the binding is active.
1119
1119
1120
-
## `@_section("section_name")`
1121
-
1122
-
Places a global variable or a top-level function into a section of the object
1123
-
file with the given name. It's the equivalent of clang's
1124
-
`__attribute__((section))`.
1125
-
1126
1120
## `@_semantics("uniquely.recognized.id")`
1127
1121
1128
1122
Allows the optimizer to make use of some key invariants in performance critical
@@ -1320,12 +1314,6 @@ for more details.
1320
1314
1321
1315
This `async` function uses the pre-SE-0338 semantics of unsafely inheriting the caller's executor. This is an underscored feature because the right way of inheriting an executor is to pass in the required executor and switch to it. Unfortunately, there are functions in the standard library which need to inherit their caller's executor but cannot change their ABI because they were not defined as `@_alwaysEmitIntoClient` in the initial release.
1322
1316
1323
-
## `@_used`
1324
-
1325
-
Marks a global variable or a top-level function as "used externally" even if it
1326
-
does not have visible users in the compilation unit. It's the equivalent of
1327
-
clang's `__attribute__((used))`.
1328
-
1329
1317
## `@_weakLinked`
1330
1318
1331
1319
Allows a declaration to be weakly-referenced, i.e., any references emitted by
0 commit comments