Commit Graph

4080 Commits

Author SHA1 Message Date
swift-ci
96a47e7353 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-11 11:14:21 -08:00
Holly Borla
f04f512184 [Macros] Add a new macro role for attached peer macros. 2023-02-10 14:38:22 -08:00
swift-ci
270394d630 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-10 12:13:32 -08:00
Alexis Laferrière
62a646974f [Serialization] Move deserialization safety behind an env var or flag 2023-02-09 17:29:06 -08:00
Alexis Laferrière
09b06a8cd3 Revert "[Serialization] Enable deserialization safety by default"
This reverts commit af70cc5464.

# Conflicts:
#	test/Serialization/Safety/unsafe-decls.swift
2023-02-09 15:28:42 -08:00
swift-ci
ff1899f6ec Merge remote-tracking branch 'origin/main' into rebranch 2023-02-09 09:33:22 -08:00
Pavel Yaskevich
8eebb5bec1 Merge pull request #63522 from xedin/revert-type-wrappers
[AST/Sema/SIL] Revert TypeWrappers feature functionality
2023-02-09 09:27:18 -08:00
swift-ci
27ada2f087 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-09 06:53:08 -08:00
Doug Gregor
c085f5afd9 Record original source range of generated source buffers into dumped files
This helps us establish where the code from a generated source buffer
would go, for external tools that don't understand serialized
diagnostics.
2023-02-08 18:08:33 -08:00
swift-ci
d9c1f28d98 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-08 15:13:37 -08:00
Doug Gregor
85ba74b812 Introduce a separate feature to cover @freestanding(expression) 2023-02-08 11:26:14 -08:00
Pavel Yaskevich
61ab4d539d [Frontend] Remove TypeWrappers flag and associated attributes 2023-02-08 09:27:07 -08:00
swift-ci
68e72ce6c1 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-07 20:33:37 -08:00
Alex Lorenz
1a763c0cbc Merge pull request #63336 from hyp/eng/emit-symbolic-interfaces
[interop] Emit symbolic interfaces while indexing
2023-02-07 20:24:36 -08:00
swift-ci
6545e20750 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-06 19:53:54 -08:00
Dario Rexin
a8bea1e70a [SILOpt] Reject existentials in AnyObject specialization application (#63477)
Also allow this feature to be enabled in non-assert compilers
2023-02-06 19:40:05 -08:00
swift-ci
1a8ead7280 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-06 05:53:34 -08:00
Alex Hoppen
a5f85ee10c [SourceKit] Make sure we reuse ASTContext in function bodies for solver-based cursor info
The main problem that prevented us from reusing the ASTContext was that we weren’t remapping the `LocToResolve` in the temporary buffer that only contains the re-parsed function back to the original buffer. Thus `NodeFinder` couldn’t find the node that we want to get cursor info for.

Getting AST reuse to work for top-level items is harder because it currently heavily relies on the `HasCodeCompletion` state being set on the parser result. I’ll try that in a follow-up PR.

rdar://103251263
2023-02-02 22:03:25 +01:00
Alex Lorenz
f36e5cf641 [interop] add 'ImportSymbolicCXXDecls' experimental import mode for importing class templates syntactically but not semantically 2023-01-31 14:58:13 -08:00
swift-ci
ef62fdf232 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-31 11:53:53 -08:00
Doug Gregor
919da2c6c0 Enable emission of macro expansion buffers for diagnostics by default
This feature is too handy to leave off-by-default. Enable it by
default, but allow `-emit-macro-expansion-files no-diagnostics` to
disable it.
2023-01-30 18:16:20 -08:00
Doug Gregor
8871129896 [Macros] Add frontend flag to dump macro expansions for diagnostics.
Add frontend flag `-emit-macro-expansion-files diagnostics` to emit any
macro expansion buffers referenced by diagnostics into files in a
temporary directory. This makes debugging type-checking failures in
macro expansions far easier, because you can see them after the
compiler process has exited.
2023-01-30 18:05:53 -08:00
swift-ci
7bab68c056 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-27 07:37:00 -08:00
Holly Borla
f6f57a8099 [Macros] Rename "synthesized member macros" to "member macros". 2023-01-26 21:52:36 -08:00
swift-ci
791d160814 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-26 10:34:25 -08:00
Ben Barham
4380ee659a Merge pull request #63227 from bnbarham/optional-api-update
Update `llvm::Optional` API uses
2023-01-26 10:19:51 -08:00
swift-ci
0ae72a3a9d Merge remote-tracking branch 'origin/main' into rebranch 2023-01-26 07:34:09 -08:00
Michael Gottesman
89176928ee Merge pull request #63213 from gottesmm/rdar103271138
[move-only] Implement borrow+struct_extract to restructure transform
2023-01-26 07:19:10 -08:00
Ben Barham
3ec878d918 Update llvm::Optional API uses
Use the std-equivalent names as the LLVM ones are now deprecated
(eventually `llvm::Optional` will disappear):
  - `getValue` -> `value`
  - `getValueOr` -> `value_or`
  - `hasValue` -> `has_value`

Follow up from ab1b343dad and
7d8bf37e5e with some missing cases.
2023-01-25 16:28:10 -08:00
swift-ci
e0b16dbdf4 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-25 16:07:15 -08:00
Holly Borla
c707643396 Merge pull request #63059 from hborla/synthesized-member-macros
[Macros] Initial support for synthesized member macros.
2023-01-25 07:28:16 -08:00
Kavon Farvardin
9d65c9e81e enable move-only and move-only classes in production builds 2023-01-24 16:01:23 -08:00
Michael Gottesman
e2b5c03c77 [frozen-multi-map] Add the ability to "unfreeze" the multi-map so one can add incrementally more elements to the multi-map.
For those unfamiliar, this map is a vector of pairs that we stable sort by the
key when we "freeze" it so we can run map operations upon the keys. This allows
one to accumulate into the multi-map and then once one has finished
accumulating, perform these map operations.

While doing some work in the move checker, I thought I would need the ability to
incrementally update a multi-map by appending more entires. Due to the design,
supporting this is as simple as unfreezing the map. This results in one being no
longer able to run map operations without hitting an assert. When one freezes
again, the stable sort will put the new entries in the appropriate place in the
already sorted initial part of the array.

Turns out I didn't need this, but seemed useful, so I am upstreaming it.
2023-01-24 15:28:11 -08:00
swift-ci
57fbdaf64c Merge remote-tracking branch 'origin/main' into rebranch 2023-01-24 07:14:58 -08:00
swift-ci
ca1f3f7a54 Merge pull request #63179 from kavon/moveonly-structs-or-enums
Limit `@_moveOnly` to structs and enums
2023-01-24 07:05:24 -08:00
Erik Eckstein
87ed8b4dc3 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-24 08:58:16 +01:00
Kavon Farvardin
1356694043 experimentally allow move-only classes
A lot of existing regression tests rely on there
being some form of move-only classes, despite
them being something that will not be available
to users (and not complete).

This change introduces a `MoveOnlyClasses`
experimental feature so that those tests don't
need to be fully rewritten just yet. You need to
include `-enable-experimental-feature MoveOnlyClasses` along with
`-enable-experimental-move-only` to get move-only classes.
2023-01-23 22:33:27 -08:00
Alexis Laferrière
a0ee5c5312 Merge pull request #63116 from xymus/deser-safety-by-default
[Serialization] Enable deserialization safety by default
2023-01-23 17:18:48 -08:00
Holly Borla
8b9be30783 [Macros] Add a new macro role for synthesized member macros. 2023-01-22 21:19:21 -08:00
Doug Gregor
bdf1183757 [Diagnostics] Add a swift-syntax diagnostic style
The SwiftDiagnostics module within swift-syntax has a diagnostic
pretty-printer that does a nice rendering of the source code with
diagnostics placed inside gaps between the code lines.
Introduce another `-diagnostic-style` argument, `swift-syntax`,
to bridge from the pretty-printed C++ diagnostics over to the
swift-syntax diagnostics engine.
2023-01-21 23:09:56 -08:00
Doug Gregor
31a3d8e329 Introduce infrastructure to dump generated source buffers into temporary files 2023-01-19 21:30:22 -08:00
Alexis Laferrière
af70cc5464 [Serialization] Enable deserialization safety by default
rdar://99495048
2023-01-19 10:50:55 -08:00
Alastair Houghton
5b348006cb [Basic] Fix TaggedUnion to work around VS2019 ICE.
MSVC doesn't like the `std::enable_if<>` in the second argument.
Since we already have a `template<>` just above, move it there.
2023-01-16 15:20:52 +00:00
swift-ci
d2d8b07634 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-15 16:34:43 -08:00
Holly Borla
1b74d6cfcc [SourceManager] Distinguish between the various macro roles in
GeneratedSourceInfo::Kind.
2023-01-15 10:11:00 -08:00
swift-ci
e55fa383d6 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-13 16:15:24 -08:00
Doug Gregor
91ee109c2f [Macros] Start expanding accessor macros attached to a storage declaration.
Accessor macros are attached macros (written with attribute syntax)
that can generate accessors for a property or subscript. Recognize
custom attributes that are accessor macros when written on a storage
declaration, and expand those macros.

This is very much a work in progress, and the result of the expansion
isn't yet parsed or wired into the AST.
2023-01-13 10:12:25 -08:00
swift-ci
a47a551761 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-12 14:25:23 -08:00
Max Desiatov
7ccb605386 Basic/type_traits: use __is_identifier for some feature checks (#62993)
* Basic/type_traits: use `__is_identifier` for some feature checks

When building on Alpine with Musl `__has_feature(is_trivially_constructible)` does not work, even though `__is_trivially_constructible` is defined and `__has_trivial_constructor` is deprecated. Same for `__is_trivially_destructible` and `__has_trivial_destructor` respectively.

* Basic/type_traits: use `__has_feature` or `__has_keyword`

That potentially makes these checks more future-proof in case more edge cases are introduced on different platforms.
2023-01-12 22:08:06 +00:00
Alexis Laferrière
4507307b35 Merge pull request #62982 from xymus/deser-safety-step2
[Serialization] Misc prep for the deserialization safety feature
2023-01-12 13:42:28 -08:00