Commit Graph

11 Commits

Author SHA1 Message Date
Anthony Latsis
7b92a8f041 AST: Quote attributes more consistently in DiagnosticsParse.def 2025-04-23 19:18:11 +01:00
Allan Shortlidge
0ac53e33e6 Sema: Only warn about @_originallyDefinedIn attributes on non-public decls for the active platform. This prevents diagnostic spam for the common case where multiple platforms are listed in the same attribute. This has the unfortunate side effect that some useful diagnostics will be skipped depending on target platform, but it makes the behavior of this diagnostic consistent with the rest for this attribute.
Resolves rdar://90779221.
2022-03-25 10:48:03 -07:00
Allan Shortlidge
b29251219a Parse: Add availability macro support to @_backDeploy attribute parsing. Consolidate parsing code shared between @_originallyDefinedIn and @_backDeploy. 2022-03-08 14:13:10 -08:00
Allan Shortlidge
da2ae43b4f Sema: Diagnose invalid back deployed declarations. Back deployed declarations must:
- have public visibility
- have at most one back deployment version per-platform
- specify an introduced version for each platform with a back deployment version using @available
- have a back deployment version that is greater than the introduced version
- not have conflicting attributes like @_alwaysEmitIntoClient

Refactor to share code with type checking for @_originallyDefinedIn which has overlapping diagnostics.
2022-02-28 16:00:28 -08:00
Allan Shortlidge
12102c4181 [Sema] Warn if the @_originallyDefinedIn attribute is applied to a decl that is inaccessible outside the current module.
Resolves rdar://82441657
2022-02-01 16:51:03 -08:00
Nathan Hawes
9bcb54910e [AST] Prefer the 'macOS' spelling over 'OSX' when printing the platform kind.
This affects module interfaces, interface generation in sourcekitd, and
diagnostics. Also fixes a fixit that was assuming the 'OSX' spelling when
computing the source range to replace.

Resolves rdar://problem/64667960
2020-07-08 13:51:25 -07:00
Xi Ge
56110b8064 Sema: refactor some code to diagnose multiple active platforms for @_originallyDefinedFrom. NFC 2020-01-22 13:29:38 -08:00
Xi Ge
624c2fc4a7 test: move demangle metadata for moved symbols to a separate file 2019-12-17 12:22:22 -08:00
Xi Ge
cf79163764 test: update test to combine @available with @_originallyDefinedIn 2019-12-17 11:29:56 -08:00
Xi Ge
aa1e4eec86 sema: check if @_originalDefinedIn attribute has duplicated entries for the same platform name 2019-11-21 17:04:00 -08:00
Xi Ge
7f8c04e0b7 AST: introduce a new attribute @_originallDefinedIn to the AST
We need this attribute to teach compiler to use a different name from the current
module name when generating runtime symbol names for a declaration. This is to serve
the workflow of refactoring a symbol from one library to another without breaking the existing
ABI.

This patch focuses on parsing and serializing the attribute, so @_originallyDefinedIn
will show up in AST, swiftinterface files and swiftmodule files.

rdar://55268186
2019-11-21 14:25:57 -08:00