Commit Graph

4080 Commits

Author SHA1 Message Date
Tim Kientzle
174983f619 Merge pull request #74581 from tbkka/tbkka-assertions-2
Minor improvements to new ASSERT macros
2024-06-20 16:34:23 -07:00
Tim Kientzle
967fde0750 Minor improvements to new ASSERT macros
Three minor changes:
* Remove unneeded stdint.h inclusion
* Use __FILE_NAME__ instead of __FILE__ to reduce code size
* Write location as "file:line" for better compatibility with existing tools
2024-06-20 11:34:36 -07:00
swift-ci
7bdccb824a Merge remote-tracking branch 'origin/main' into rebranch 2024-06-19 10:35:32 -07:00
Holly Borla
4bec599931 Merge pull request #74543 from hborla/promote-isolated-any
[Features] Promote `IsolatedAny` and its alias to a language feature.
2024-06-19 10:32:30 -07:00
Holly Borla
966269d31a [Features] Promote IsolatedAny and its alias to a language feature.
The proposal is accepted and implemented for Swift 6.0.
2024-06-18 22:09:16 -07:00
Mateus Rodrigues
013997dae7 Implement trailing comma for comma-separated lists 2024-06-18 14:01:38 -03:00
swift-ci
90e423a11e Merge remote-tracking branch 'origin/main' into rebranch 2024-06-15 19:15:50 -07:00
Holly Borla
32aba12db3 [Features] FullTypedThrows should only be enable-able in asserts builds.
The implementation of this experimental feature is not complete and it's
not ready to be enabled in production.
2024-06-14 21:21:27 -07:00
swift-ci
2cf1694e17 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-10 08:54:15 -07:00
Joe Groff
f819bed190 Make BorrowingSwitch a LANGUAGE_FEATURE.
It doesn't guard any source breaks, so it doesn't need to be an UPCOMING_FEATURE.
rdar://129417451
2024-06-07 14:26:23 -07:00
swift-ci
8e1f8e5668 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-05 21:14:30 -07:00
Joe Groff
efc193ffa3 Merge pull request #74154 from jckarter/treat-reinit-attempts-in-multi-block-defers-as-errors
Turn mishandled reinitialize-in-`defer`-after-`consume` cases into errors.
2024-06-05 21:04:34 -07:00
Joe Groff
74aaf88697 Turn mishandled reinitialize-in-defer-after-consume cases into errors.
The handling of multi-basic-block control flow in `defer` blocks looks like it
was left incomplete and completely untested; I fixed a few obvious problems but
it still completely lacks any analysis of conditional reinitializations. For now,
change it to treat attempted reinitializations as uses-after-consumes so we raise
reliable errors now instead of emitting code that causes memory corruption at
runtime. Fixes rdar://129303198.
2024-06-05 14:12:00 -07:00
swift-ci
8c10cc2271 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-03 21:55:36 -07:00
Konrad `ktoso` Malawski
083fdaa0de Merge pull request #73998 from nickolas-pohilets/mpokhylets/fix-32-build 2024-06-04 13:49:19 +09:00
swift-ci
5abac881ad Merge remote-tracking branch 'origin/main' into rebranch 2024-06-02 15:34:45 -07:00
Michael Gottesman
88729b9e34 [sending] Make {Transferring,Sending}ArgsAndResults a LANGUAGE_FEATURE instead of an UPCOMING_FEATURE.
TLDR: This makes it so that we always can parse sending/transferring but changes
the semantic language effects to be keyed on RegionBasedIsolation instead.

----

The key thing that makes this all work is that I changed all of the "special"
semantic changes originally triggered on *ArgsAndResults to now be triggered
based on RegionBasedIsolation being enabled. This makes a lot of sense since we
want these semantic changes specifically to be combined with the checkers that
RegionBasedIsolation turns on. As a result, even though this causes these two
features to always be enabled, we just parse it but we do not use it for
anything semantically.

rdar://128961672
2024-06-01 23:25:16 -07:00
swift-ci
1761e80209 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-31 09:54:45 -07:00
Rintaro Ishizaki
13944dcc0a Merge pull request #74031 from rintaro/basic-fixedbitset-chunkmask
[Basic] Fix return type of FixedBitSet::chunkMask()
2024-05-31 09:51:05 -07:00
Rintaro Ishizaki
a8cc312e50 [Basic] Fix return type of FixedBitSet::chunkMask()
Fix a warning in msvc compiler: warning C4334: '<<': result of 32-bit
shift implicitly converted to 64 bits (was 64-bit shift intended?)
2024-05-30 13:36:29 -07:00
Mykola Pokhylets
987b641a7c Updated HeaderFooterLayout to correctly handle empty Header or Footer 2024-05-30 21:56:28 +02:00
swift-ci
63205ba9a2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-30 09:54:36 -07:00
Rauhul Varma
9a280613c3 Merge pull request #73963 from apple/cxx-swift-symbolgraph-extract
[SymbolGraphGen] Handle cxx module imports in swift-symbolgraph-extract
2024-05-30 09:48:57 -07:00
Mykola Pokhylets
b5e039d1e0 Fixed 32-bit build with SWIFT_CONCURRENCY_ENABLE_PRIORITY_ESCALATION 2024-05-30 13:15:39 +02:00
Mykola Pokhylets
6298d41edf Reapply "Fix quadratic performance of the ListMerger in specific usage pattern"
This reverts commit 2640ff613b.
2024-05-30 13:08:42 +02:00
Rauhul Varma
808ccd47ff [SymbolGraphGen] Handle cxx module imports in swift-symbolgraph-extract
Updates swift-symbolgraph-extract to parse "-cxx-interoperability-mode"
flags and update the underlying compiler invocation. This fixes a bug
where were are unable to extract the symbol graph from swiftmodules with
transitive cxx modules because we parsed cxx headers as c headers.

rdar://128888548 (Add support for parsing cxx headers)
2024-05-29 13:03:27 -07:00
swift-ci
bc80f1ca21 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-28 17:50:40 -07:00
Tim Kientzle
65f78e6268 Merge pull request #73675 from tbkka/tbkka-assertions-v2
New assertions support
2024-05-28 17:25:21 -07:00
swift-ci
deecdcc5ef Merge remote-tracking branch 'origin/main' into rebranch 2024-05-23 16:14:20 -07:00
nate-chandler
33c76b6c62 Merge pull request #73843 from nate-chandler/rdar128611158
[Features] Move NoncopyableGenerics up.
2024-05-23 16:08:55 -07:00
Nate Chandler
60cdbb84a5 [Features] Move NoncopyableGenerics up.
Some compilers have the NoncopyableGenerics feature enabled via
interesting mechanisms but do not have ConformanceSuppression.  To
support such compilers, the NoncopyableGenerics feature must appear
before ConformanceSuppression in the list of features.  Otherwise, when
parsing the portion of the swiftinterface corresponding to an entity
which involves both features, the first check will be for
NoncopyableGenerics (which that old compiler has) and the code inside
will involve ConformanceSuppression (which that old compiler does not
have).

rdar://128611158
2024-05-23 10:12:01 -07:00
swift-ci
eb8e2fcb7d Merge remote-tracking branch 'origin/main' into rebranch 2024-05-22 16:34:36 -07:00
Steven Wu
68c755e99c [Caching] Temporarily using llvm style diagnostics in caching
When caching is enabled, using swift style diagnotics can lead to
crashes due to some uninitialized variables. Even more, the swift style
diagnostics is not going to render the same when replay from the cache
since the currect caching diagnostics processor is not capture all
information that is needed to render diagnostis from SwiftSyntax.
Temprarily using llvm style for caching builds.

rdar://127530204
2024-05-22 13:15:08 -07:00
swift-ci
86cab09f9a Merge remote-tracking branch 'origin/main' into rebranch 2024-05-21 20:54:13 -07:00
Andrew Trick
2640ff613b Revert "Fix quadratic performance of the ListMerger in specific usage pattern" 2024-05-21 16:23:57 -07:00
swift-ci
5783e78fc1 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-21 13:33:52 -07:00
Doug Gregor
2388acdfd3 [SE-0415] Enable function body macros by default
Preamble macros are *not* part of the revised SE-0415, so leave them
experimental.

Tracked by rdar://119687390.
2024-05-20 22:08:33 -07:00
swift-ci
1d0abfc691 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-20 17:34:38 -07:00
Artem Chikin
31337dd004 Merge pull request #69706 from artemcm/DepScanCPPInterop
[Explicit Module Builds] C++ Interoperability mode fixes
2024-05-20 20:29:17 -04:00
swift-ci
442d48a4a1 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-20 14:36:59 -07:00
John McCall
e1a82f622e Merge pull request #70910 from nickolas-pohilets/mpokhylets/fix-list-merger-performance
Fix quadratic performance of the `ListMerger` in specific usage pattern
2024-05-20 17:26:34 -04:00
artemcm
ec4e0e23aa Allow users to opt-out of implicit Cxx import with -disable-implicit-cxx-module-import 2024-05-20 11:18:45 -07:00
swift-ci
b20fedebc6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-18 02:54:31 -07:00
Michael Gottesman
20a3589763 [sending] Enable sending whenever region isolation is enabled and make SE-0430 an upcoming feature.
I also added support for expressing suppressable upcoming features.

rdar://128216574
2024-05-17 19:56:29 -07:00
Tim Kientzle
bb8c96c2b9 Optimize for assertion success and assertions disabled 2024-05-17 09:30:03 -07:00
Michael Gottesman
b780ff6696 [sending] Begin parsing 'sending' while still accepting 'transferring'.
A few things:

1. Internally except for in the parser and the clang importer, we only represent
'sending'. This means that it will be easy to remove 'transferring' once enough
time has passed.

2. I included a warning that suggested to the user to change 'transferring' ->
'sending'.

3. I duplicated the parsing diagnostics for 'sending' so both will still get
different sets of diagnostics for parsing issues... but anywhere below parsing,
I have just changed 'transferring' to 'sending' since transferring isn't
represented at those lower levels.

4. Since SendingArgsAndResults is always enabled when TransferringArgsAndResults
is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So
we import "transferring" as "sending". This means that even if one marks a
function with "transferring", the compiler will guard it behind a
SendingArgsAndResults -D flag and in the imported header print out sending.

rdar://128216574
2024-05-16 21:43:50 -07:00
Tim Kientzle
37e5f30d0b Add some basic assertion handling control options 2024-05-16 15:04:49 -07:00
Tim Kientzle
5b49a04ddc New assertions support
This adds three new assertion macros:
* `ASSERT` - always compiled in, always checked
* `CONDITIONAL_ASSERT` - always compiled in, checked whenever the `-compiler-assertions` flag is provided
* `DEBUG_ASSERT` - only compiled into debug builds, always checked when compiled in  (functionally the same as Standard C `assert`)

The new `-compiler-assertions` flag is recognized by both `swift-frontend` and
`swiftc`.

The goal is to eventually replace every use of `assert` in the compiler with one of the above:
* Most assertions will use `ASSERT` (most assertions should always be present and checked, even in release builds)
* Expensive assertions can use `CONDITIONAL_ASSERT` to be suppressed by default
* A few very expensive and/or brittle assertions can use `DEBUG_ASSERT` to be compiled out of release builds

This should:
* Improve quality by catching errors earlier,
* Accelerate compiler triage and debugging by providing more accurate crash dumps by default, and
* Allow compiler engineers and end users alike to add `-compiler-assertions` to get more accurate failure diagnostics with any compiler
2024-05-16 11:38:00 -07:00
swift-ci
99593fa393 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 11:14:36 -07:00
Joe Groff
2c6bfa23c8 Merge pull request #72967 from jckarter/enable-borrowing-switch-frontend
Enable 'BorrowingSwitch' feature.
2024-05-15 10:57:07 -07:00