Commit Graph

4149 Commits

Author SHA1 Message Date
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
swift-ci
38df85afd6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 08:16:25 -07:00
Kavon Farvardin
5ae2f6bd25 CxxInterop: use Unsafe*Pointer for move-only 2024-05-14 17:44:22 -07:00
Joe Groff
10f9289ef8 Enable 'BorrowingSwitch' feature. 2024-05-14 07:31:59 -07:00
swift-ci
0a35a97bbf Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 22:34:13 -07:00
Michael Gottesman
de85b79423 [concurrency] Make GlobalActorIsolatedTypesUsability an upcoming swift 6 feature.
rdar://118244451
2024-05-13 18:40:58 -07:00
swift-ci
85e6e794ca Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 13:15:29 -07:00
Steven Wu
431f097e7c [Caching] Mark -typecheck action as caching supported
This is a regression causing lots of cached diagnostics tests not
functioning since the cached diagnostics processors are not initialized
for those tests which are supposed to test diagnostics caching.

The regression is caused by the fix that the typecheck module interface
job need to run a typecheck job in the sub-invocation. Now the typecheck
module interface job is correctly setup to avoid diagnostics about
unsupported file system error.
2024-05-13 09:36:12 -07:00
Mykola Pokhylets
9ba09ff63d Process incoming queue when obtaining drainer lock 2024-05-10 11:05:22 +02:00
Mykola Pokhylets
40c38f9803 Using multiple insertion points to ensure all jobs are always inserted in O(1)
Fully separated unprocessed jobs and processed jobs
Reverse jobs after updating status to minimise contention
2024-05-10 11:05:22 +02:00
Mykola Pokhylets
21a70e10c7 Fixed quadratic performance of ListMerger when each executed job creates 2+ new jobs of the same priority
See https://forums.swift.org/t/quadratic-performance-of-the-listmerger-in-specific-use-case/69393
2024-05-10 11:05:22 +02:00
swift-ci
e748732b00 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-09 07:14:34 -07:00
Nate Chandler
2671652085 [BitwiseCopyable] Avoid a condfail.
The standard library defines
```
protocol BitwiseCopyable {}
typealias _BitwiseCopyable = BitwiseCopyable
```
For current compilers, `BitwiseCopyable` is a "known protocol".

For older compilers, it is not; instead `_BitwiseCopyable` is.  So
print the following into the swiftinterface for those older compilers:
```
protocol _BitwiseCopyable {}
typealias BitwiseCopyable = _BitwiseCopyable
```

rdar://127755503
2024-05-08 16:53:14 -07:00
swift-ci
ac90898851 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-08 16:34:07 -07:00
Kavon Farvardin
0420310623 NCGenerics: it's no longer "experimental"
resolves rdar://127701059
2024-05-08 10:49:12 -07:00
swift-ci
d0709e4c11 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-07 09:14:00 -07:00
Holly Borla
e7db0ec8f8 Merge pull request #73472 from hborla/exhaustive-switch-error
[Sema] Non-exhaustive switch statements are always an error in Swift 6.
2024-05-07 09:03:40 -07:00
Holly Borla
a7920ce50b [Features] Replace -enable-nonfrozen-enum-exhaustivity-diagnostics with an
upcoming feature.

The bespoke flag still works as a way to enable the `NonfrozenEnumExhaustivity`
upcoming feature. `NonfrozenEnumExhaustivity` is enabled by default in the
Swift 6 language mode as errors, and enabled by default in the Swift 5 language
mode as warnings.
2024-05-06 20:56:20 -07:00
swift-ci
34168db45e Merge remote-tracking branch 'origin/main' into rebranch 2024-05-06 12:14:08 -07:00
Nate Chandler
c10d39e35f [AST] Remove Builtin.copy.
A vestigial remnant of it was left behind after
06921cfe84 in order to avoid a reverse
condfail when building old swiftinterfaces that define

```swift
func _copy<T>(_ value: T) -> T {
  #if $BuiltinCopy
    Builtin.copy(value)
  #else
    value
  #endif
}
```

If the language feature is removed, though, such interfaces should again
be buildable because the branch where the language feature isn't defined
should be expanded.

rdar://127516085
2024-05-04 11:35:17 -07:00
swift-ci
692ca26160 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-04 10:34:18 -07:00
nate-chandler
bcd08c0c9a Merge pull request #73235 from nate-chandler/bitwise-copyable/enable
[BitwiseCopyable] Promote to feature.
2024-05-04 10:16:40 -07:00
swift-ci
61ac921c6b Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 22:14:30 -07:00
Alejandro Alonso
19e722eea4 Manually implement popcount when not available 2024-05-01 14:48:43 -07:00
swift-ci
7af405827e Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 08:16:56 -07:00
Alejandro Alonso
d380bf9ae3 Merge pull request #73277 from Azoy/fix-conditional-invertible
[IRGen] Fix misalignment of conditional invertible requirement counts
2024-05-01 08:10:46 -07:00
swift-ci
480a3378d9 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-30 20:54:40 -07:00
Becca Royal-Gordon
981233ad37 Merge pull request #73128 from beccadax/objcimpl-resilient
Handle resilient stored properties in objcImpl
2024-04-30 20:50:33 -07:00
swift-ci
87ee938fc1 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-30 19:34:29 -07:00
Michael Gottesman
dc25857805 [transferring] Make transferring suppressible and validate that we do suppress transferring in swift interface files.
Importantly I added tests that validated this behavior.

rdar://126780823
2024-04-30 16:40:40 -07:00
Becca Royal-Gordon
f94ed6d606 Hide objcImpl resilience support behind feature
Resilence support will require changes to the Objective-C runtime to expand support for metadata initialization functions. Add a separate experimental feature flag to help with staging that support in, and modify diagnostics to not suggest increasing the minimum deployment target for now.
2024-04-30 12:03:46 -07:00
Alejandro Alonso
852ef0bc01 Define a popcount util
add include

Define a popcount util

Update MathUtils.h
2024-04-30 09:16:37 -07:00