Commit Graph

77 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
dc5e354d69 [Concurrency] Reimplement @TaskLocal as a macro (#73078) 2024-05-01 20:57:20 -07:00
Pavel Yaskevich
e6b445b8d1 [SE-0428] NFC: Rename _DistributedProtocol macro into Resolvable
The proposal was [accepted with modifications](https://forums.swift.org/t/accepted-with-modifications-se-0428-resolve-distributedactor-protocols/71366)

The decision was made to change the spelling of the attached macro
in the proposal from @DistributedProtocol to `@Resolvable`
(or `@Distributed.Resolvable` if disambiguation is needed).
2024-04-22 14:18:11 -07:00
Konrad `ktoso` Malawski
5df0f053d9 [Distributed][Macro] Improve diagnostics, handle edge cases, properties, assoc types (#73046) 2024-04-18 12:38:02 +09:00
Konrad `ktoso` Malawski
6132386371 [Distributed] Complete handling of protocol calls and witnesses using adjusted mangling scheme (#72416) 2024-03-23 23:54:23 +09:00
Hamish Knight
dd8c7faf3c [cmake] Add missing dependency SwiftMacros -> SwiftOperators 2024-03-13 21:26:49 +00:00
Konrad `ktoso` Malawski
27702fa115 [Distributed][Macro] Handle more cases in distributed protocol macro (#72177) 2024-03-12 02:12:31 -07:00
Mishal Shah
b488702cc9 Merge remote-tracking branch 'origin/main' into bump-swift-version-to-6 2024-02-20 21:04:47 -08:00
Mishal Shah
96d61d3c5c Merge remote-tracking branch 'origin/main' into bump-swift-version-to-6 2024-02-20 14:31:55 -08:00
Konrad `ktoso` Malawski
f03ddf728b [Macros] Reproduce issue with peer+extension macro extension's methods not being checked as witnesses (#71717)
Co-authored-by: Pavel Yaskevich <pyaskevich@apple.com>
2024-02-20 00:50:29 -08:00
Mishal Shah
af112c1591 Update the Swift version to 6.0 from 5.11 2024-02-19 17:47:16 -08:00
Dave Lee
fc23eef2d2 Disable macro on windows (#71685)
On windows (PECOFF), the `static let` properties produced by `DebugDescriptionMacro` 
are not constants, and as a result the `@_section` macro cannot be applied. The error 
message is:

> global variable must be a compile-time constant to use `@_section` attribute

Until this issue is addressed, DebugDescriptionMacro is disabled for windows targets.
2024-02-19 15:01:11 -08:00
Dave Lee
63e42a4f36 Switch to __TEXT segment (#71639)
The data emitted by `DebugDescriptionMacro` is constant. For that reason, it was placed 
in `__DATA_CONST`. However, this causes a problem with the linker, which emits an error 
 if the `__DATA_CONST` segment is _not_ marked `SG_READ_ONLY`.

After discussion, it was pointed out that if the constant data has no fixups, then it 
can and should be in the the `__TEXT` segment. The `__DATA_CONST` segment is for data 
that is essentially constant but contains dyld fixups.
2024-02-16 07:49:40 -08:00
Konrad `ktoso` Malawski
827e6a5708 [Distributed] Add DistributedProtocol macro (#71090) 2024-02-16 07:27:34 +09:00
Dave Lee
3a43e7d689 [Debug] Fix regex type names in DebugDescriptionMacro (#71379)
Fixes the way `DebugDescriptionMacro` produces a regex type name.

The problem was use of backslash escapes that weren't sufficiently escaped. They needed 
to be double escaped. To avoid this trap, the regexes now use `[.]` to match a dot, 
instead of the more conventional `\.` syntax.
2024-02-05 10:49:01 -08:00
Dave Lee
67677742b0 [Debug] Remove temp workaround in DebugDescriptionMacro (#70746)
This workaround is no longer needed, as of https://github.com/apple/swift/pull/70435.
2024-01-07 16:59:08 -08:00
Dave Lee
96faeb5177 [Debug] Accept _debugDescription in DebugDescriptionMacro (#70728)
Some data types cannot modify their `description` or `debugDescription` properties, as 
modification to those properties could result in breakage to their users. To support 
these conditions, `DebugDescriptionMacro` should support and prioritize an independent 
property (one that that is not being reused).

This change adds support for `_debugDescription`. The macro will now prioritize the 
description properties in this order:

1. `_debugDescription`
2. `debugDescription`
3. `debugDescription`

rdar://120498021
2024-01-05 15:16:01 -08:00
Dave Lee
ad585b3195 [Debug] Add _DebugDescription macro (#69626)
Implementation of the DebugDescription macro pitched on the forums: 
https://forums.swift.org/t/pitch-debug-description-macro/67711. In this initial commit, 
the macro is named `_DebugDescription` to indicate it's internal use at this time, 
pending Swift Evolution.

rdar://115180949
2023-12-08 15:19:16 -08:00
Ben Barham
041691184c [CMake] Replace early swift-syntax with FetchContent
Use FetchContent to include swift-syntax directly in swift. This can be
thought of as an `add_subdirectory` for a directory outside the root.

The default build directory will be `_deps/swiftsyntax-subbuild/`, though
the modules and shared libraries will be built in `lib/swift/host` by
passing down `SWIFT_HOST_LIBRARIES_DEST_DIR` to avoid copying them as we
were doing previously.
2023-09-18 14:44:10 -07:00
Alex Hoppen
8231b272ba [ASTGen/Macros] Update for the fact that syntax collections are always non-optional in SwiftSyntax now 2023-08-11 07:46:59 -07:00
Holly Borla
d03ef5ad99 [Macros] Replace all uses of the ConformanceMacro protocol with ExtensionMacro. 2023-08-04 22:32:30 -07:00
Alex Hoppen
62db3d5ad2 [Macros] Fix SwiftSyntax deprecation warnings 2023-08-03 10:44:09 -07:00
Alex Hoppen
42cb41ded9 Adjustment for SwiftSyntax rename members -> memberBlock
Companion of https://github.com/apple/swift-syntax/pull/1524
2023-04-13 16:28:54 -07:00
Rintaro Ishizaki
f9fba6ce3e [CMake] Move add_pure_swift_host_library to a file
* Move `add_pure_swift_host_library()` from lib/CMakeLists.txt to
  AddPureSwift.cmake so that code outside `lib` can use it
* Add `add_pure_swift_host_tool()` function to make a pure Swift
  host executable target (for future usages)
* Specify depending `SwiftSyntax` modules explicitly because not all
  Swift libraries uses all SwiftSyntax libraries
2023-03-13 19:28:13 -07:00
Doug Gregor
5be3dee066 Drop the fancy functional stuff 2023-03-03 21:39:19 -08:00
Doug Gregor
d841369d7b [OptionSet] Try harder to appease older compilers 2023-03-03 21:39:19 -08:00
Doug Gregor
6310204e1a Make OptionSetMacro build with older Swift compilers.
My, how the language has grown.
2023-03-03 21:39:19 -08:00
Doug Gregor
0e9c3eff8a [Macros] Add OptionSet and plumb it through 2023-03-03 21:39:16 -08:00