mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
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`.
17 lines
704 B
Plaintext
17 lines
704 B
Plaintext
// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name borrow
|
|
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.2.sib -module-name borrow
|
|
// RUN: %target-sil-opt -sil-print-types %t/tmp.2.sib -module-name asmname -emit-sorted-sil | %FileCheck %s
|
|
|
|
import Swift
|
|
|
|
// CHECK: sil_global [section "__DATA,__mysection"] @v1 : $Int
|
|
sil_global [section "__DATA,__mysection"] @v1 : $Int
|
|
|
|
// CHECK: sil [section "__TEXT,__mysection"] @f : $@convention(thin) () -> ()
|
|
sil [section "__TEXT,__mysection"] @f : $@convention(thin) () -> () {
|
|
%0 = tuple ()
|
|
return %0
|
|
}
|