Commit Graph

13 Commits

Author SHA1 Message Date
Holly Borla
f8094061ad Merge pull request #71727 from hborla/double-preconcurrency
[Concurrency] Don't add redundant implicit `@preconcurrency` attributes.
2024-02-20 07:27:39 -08:00
Holly Borla
b609d804da [Concurrency] Don't add redundant implicit @preconcurrency attributes to
declarations with an explicit annotation.
2024-02-19 11:09:36 -08:00
John McCall
668297e977 Don't print conformance attributes redundantly in -preserve-types-as-written.
Since we no longer remove these attributes from the AttributedTypeRepr,
if we print based on the TypeRepr, we'll print them twice.  The best
solution is to only print the attributes based on the inheritance clause
if we're not printing the type based on the TypeRepr.

Fixes rdar://122965951.
2024-02-16 15:12:24 -05:00
John McCall
41cdfb04ad Introduce a proper TypeAttribute class hierarchy.
The old TypeAttributes reprsentation wasn't too bad for a small number of
simple attributes.  Unfortunately, the number of attributes has grown over
the years by quite a bit, which makes TypeAttributes fairly bulky even at
just a single SourceLoc per attribute.  The bigger problem is that we want
to carry more information than that on some of these attributes, which is
all super ad hoc and awkward.  And given that we want to do some things
for each attribute we see, like diagnosing unapplied attributes, the linear
data structure does require a fair amount of extra work.

I switched around the checking logic quite a bit in order to try to fit in
with the new representation better.  The most significant change here is the
change to how we handle implicit noescape, where now we're passing the
escaping attribute's presence down in the context instead of resetting the
context anytime we see any attributes at all.  This should be cleaner overall.

The source range changes around some of the @escaping checking is really a
sort of bugfix --- the existing code was really jumping from the @ sign
all the way past the autoclosure keyword in a way that I'm not sure always
works and is definitely a little unintentional-feeling.

I tried to make the parser logic more consistent around recognizing these
parameter specifiers; it seems better now, at least.
2024-01-28 22:30:26 -05:00
Holly Borla
d6f27a8a80 [Concurrency] Always print @preconcurrency instead of (unsafe) in
swiftinterfaces.
2024-01-21 19:38:35 -08:00
Allan Shortlidge
7bfc448a30 AST: Print the custom attributes attached to AttributedTypeRepr.
This ensures that global actor attributes are included when printing a `TypeRepr` representing a global actor bound function type.

Resolves rdar://105475701
2023-02-15 18:13:52 -08:00
Allan Shortlidge
747f286b8d ModuleInterface: Adopt new swiftinterface verification lit substitutions pervasively in tests where they can be adopted by simply updating or adding a few RUN: lines. 2022-04-15 20:13:00 -07:00
Doug Gregor
a6b586ded7 Ensure that we print @Sendable when printing TypeReprs.
Fixes rdar://85453819.
2022-03-09 17:51:36 -08:00
Karoy Lorentey
e2cfab4f28 [stdlib][test] Adopt availability macros in tests 2021-10-31 15:00:58 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Slava Pestov
cdbba60674 AST: ASTPrinter support for 'reasync'
Part of <rdar://problem/71098795>.
2021-02-15 22:18:54 -05:00
John McCall
a8464dcaf1 Implicitly import _Concurrency under -enable-experimental-concurrency 2020-10-22 00:53:15 -04:00
Brent Royal-Gordon
0a94737ff1 Emit -enable-experimental-concurrency into module interfaces
…when the module is built with that flag. Fixes rdar://69322538.
2020-09-24 15:26:10 -07:00