Commit Graph

184973 Commits

Author SHA1 Message Date
John Hui
c7070e73fe [NFC] [cxx-interop] Consolidate uses of findOptionSetType() helper function
Also renames it to findOptionSetEnum() to make it a bit clearer at face
value that the returned ImportedType will contain a Swift enum.

Also refactors some nearby instances of

  if (auto e = dyn_cast<ElaboratedType>(t))
      t = e->desugar();

into a helper function, desugarIfElaborated().
2025-05-19 14:10:49 -07:00
Allan Shortlidge
7acc5b988f Merge pull request #81610 from tshortli/suppress-package-cmo-spam
Frontend: Suppress some unsupported option warnings when verifying interfaces
2025-05-19 13:36:28 -07:00
Evan Wilde
5f2b0022d1 Build Swift-Testing with WMO
This tells build-script to build Swift-testing with WMO.
This results in a faster build products, but is also necessary for
configurations using the legacy swift driver, which would emit an
invalid swift interface in non-WMO builds.

Fixes: rdar://151357567
2025-05-19 13:24:23 -07:00
Hamish Knight
edca7c85ad Adopt ABORT throughout the compiler
Convert a bunch of places where we're dumping to stderr and calling
`abort` over to using `ABORT` such that the message gets printed to
the pretty stack trace. This ensures it gets picked up by
CrashReporter.
2025-05-19 20:55:01 +01:00
Hamish Knight
b8fc71c684 [AST] Fix an accidental use of llvm::errs 2025-05-19 20:55:01 +01:00
Hamish Knight
bdd74e717e [AST] Remove redundant logging in validateGenericSignature
We already setup a PrettyStackTrace to include the generic signature
on a crash.
2025-05-19 20:55:01 +01:00
Hamish Knight
be8604959e [Basic] Switch ASSERT and friends to _abortWithMessage
Ensure the message gets printed to the pretty stack trace, allowing
it to be picked up by CrashReporter.
2025-05-19 20:55:01 +01:00
Hamish Knight
a6e94ab0bd [Basic] Fallback to dumping to stderr when backtracing is disabled
Make sure we still output the error message when pretty backtracing
is disabled.
2025-05-19 20:55:01 +01:00
Hamish Knight
d672f750e7 [Basic] Rename abortWithPrettyStackTraceMessage to ABORT
Turn it into a wrapping macro that includes the file location, and
move into `Assertions.h`.
2025-05-19 20:55:01 +01:00
Hamish Knight
ffb474e0b9 [Basic] NFC: Factor out _FILENAME_FOR_ASSERT macro 2025-05-19 20:55:01 +01:00
Hamish Knight
92641253f7 [Basic] NFC: Remove ASSERT_help from header
It's not clear this is a useful utility to expose since it will only
print the message once.
2025-05-19 20:55:01 +01:00
Hamish Knight
d46aec9f00 [Basic] Handle multiline strings in abortWithPrettyStackTraceMessage
Improve the formatting by indenting to match the rest of the
pretty stack trace.
2025-05-19 20:55:01 +01:00
Charles Zablit
d575a854b3 drop wheels in favor of pip install with hashes 2025-05-19 19:53:30 +02:00
Charles Zablit
5425fd347c sync package name 2025-05-19 19:53:30 +02:00
Charles Zablit
051e9e0710 fixup! [windows] add backup pip install when no wheels are available 2025-05-19 19:53:30 +02:00
Charles Zablit
ffd801b8de [windows] add backup pip install when no wheels are available 2025-05-19 19:53:29 +02:00
Charles Zablit
f59f602ddc Revert "[windows] fix psutil installation on arm64"
This reverts commit 345452c8dbaa61a864e0dc483ad94d1aef89147b.
2025-05-19 19:53:29 +02:00
Charles Zablit
211eaa94f5 Revert "[windows] replace wheels with automatic pip install"
This reverts commit 1a309e5a06d6e29ef6fa806703b404bdbdf4e38b.
2025-05-19 19:53:29 +02:00
Charles Zablit
50dc6b8aa3 [windows] replace wheels with automatic pip install 2025-05-19 19:53:29 +02:00
Charles Zablit
6ff163bc52 [windows] fix psutil installation on arm64 2025-05-19 19:53:27 +02:00
Michael Gottesman
abcc134621 Merge pull request #81542 from gottesmm/rdar150209093_rdar151394209
[concurrency] Fix a few issues around not emitted correct protocol witness and vtable thunks for nonisolated(nonsending)
2025-05-19 10:43:18 -07:00
Mike Ash
dfc964791b Merge pull request #81562 from mikeash/error-object-weak-reference
[Runtime] Allow weak references to ErrorObjects.
2025-05-19 13:33:59 -04:00
Mykola Pokhylets
3de910970d Updated test to reflect removal of redundant boxing of unowned references 2025-05-19 18:47:28 +02:00
Alex Hoppen
2f982a4f74 Merge pull request #81524 from ahoppen/remove-code-owner
Remove Alex Hoppen as a code owner
2025-05-19 18:21:20 +02:00
Cal Stephens
1a3d71cc53 Add trailing comma support in cases missing from Swift 6.1 2025-05-19 09:19:49 -07:00
Joe Groff
21c17901b9 SIL: Resilient types don't need to be treated as addressable-for-dependencies inside their resilience domain.
Outside of the resilience domain, they have to be treated as opaque and therefore potentially
addressable-for-dependencies, but inside of the resilience domain, we may take advantage of
knowing the type layout to load indirect parameters out of memory and break the (unnecessary)
dependency on a fixed memory location. Fixes rdar://151268401.

We do still however have problems when the type is actually `@_addressableForDependencies`
inside of its resilience domain (rdar://151500074). I'll fix that in a follow up.
2025-05-19 09:07:44 -07:00
Allan Shortlidge
98aac28a3f Frontend: Suppress some unsupported option warnings when verifying interfaces.
The following warnings get emitted every time we build the compiler libraries
that are implemented in Swift:

```
<unknown>:0: warning: ignoring -allow-non-resilient-access (overriden by -compile-module-from-interface or -typecheck-module-from-interface)
<unknown>:0: warning: ignoring -package-cmo (requires -allow-non-resilient-access)
<unknown>:0: warning: ignoring -allow-non-resilient-access (overriden by -compile-module-from-interface or -typecheck-module-from-interface)
<unknown>:0: warning: ignoring -package-cmo (requires -allow-non-resilient-access)
```

These warnings are generated because `-allow-non-resilient-access` and
`-package-cmo` are being passed in with `-Xfrontend` and are therefore copied
into the interface verification jobs, even though they don't apply. Suppress
the warnings under these circumstances; they aren't going to help anyone
understand a problem, so they're just spam.

Resolves rdar://151616909.
2025-05-19 09:02:13 -07:00
Mykola Pokhylets
04166e21c9 Fixed some tests
Remaining failures:

SILGen/unowned-class-bound-generic-parameter.swift
2025-05-19 17:03:59 +02:00
Egor Zhdan
30649f2391 [cxx-interop] Temporarily disable a test for std::function on UBI 9
Similar to 0a4eeabd.

rdar://151476434
2025-05-19 16:00:39 +01:00
Erik Eckstein
a768037d0b IRGen: fix failing unconditional class casts
When unconditionally casting from a base to a final derived class, e.g. `base as! Derived`, the program did not abort with a trap.
Instead the resulting null-pointer caused a crash later in the program.
This fix inserts a trap condition for the failing case of such a cast.

rdar://151462303
2025-05-19 16:56:47 +02:00
Erik Eckstein
371e4ebd88 IRGen: extract generating a cond_fail into a utility function emitConditionalTrap
NFC
2025-05-19 16:56:47 +02:00
Erik Eckstein
078e479231 IRGen: move FailBBs from IRGenSILFunction to its base class IRGenFunction
NFC
2025-05-19 16:56:46 +02:00
Mykola Pokhylets
b138c2cc35 Updated logic for diagnosting implicit self capture to handle immutable weak capture (minor source-breaking change) 2025-05-19 16:31:01 +02:00
nate-chandler
8959f60ab1 Merge pull request #81566 from nate-chandler/rdar151325025
[MoveOnlyChecker] Don't complete phis.
2025-05-19 07:21:21 -07:00
Alastair Houghton
54f0bf2d34 Merge pull request #81527 from al45tair/fix-static-sdk-build
[Cxx] Build the C++ interop support library for the Static SDK for Linux
2025-05-19 11:40:24 +01:00
Finagolfin
17543c7bc8 [android][test] Enable tests that are now passing on the Android CI run on Windows 2025-05-19 15:17:49 +05:30
Finagolfin
432de55622 [stdlib][cmake] Disable checking for bootstrapping if the host tools aren't being built 2025-05-19 14:39:15 +05:30
Finagolfin
188a16adcb [android][test] Fix failing Frontend test on Android AArch64 CI 2025-05-19 14:33:46 +05:30
Mykola Pokhylets
4aa2847ad6 Fixed some tests
Remaining failures:

DebugInfo/guard-let-scope4.swift
expr/closure/closures.swift
SILGen/capture-transitive.swift
SILGen/dynamic_self.swift
SILGen/unowned-class-bound-generic-parameter.swift
2025-05-19 09:37:03 +02:00
Allan Shortlidge
742a96da86 Merge pull request #81593 from tshortli/strict-memory-safety-warnings
stdlib: Resolve `-strict-memory-safety` warnings
2025-05-18 22:19:31 -07:00
Saleem Abdulrasool
e79760bbed Merge pull request #81558 from compnerd/synchronise-synchronization
Runtimes: adjust the synchronization module build
2025-05-18 20:00:26 -07:00
Saleem Abdulrasool
c4b0e97c11 Merge pull request #81589 from compnerd/autolink
CommandLineSupport: add a directive for autolinking on Windows
2025-05-18 17:06:15 -07:00
Allan Shortlidge
e4f4bd36a5 Merge pull request #81592 from tshortli/embedded-swift-retain-discardable-result
Embedded: Suppress spurious unused result warnings
2025-05-18 15:24:19 -07:00
Allan Shortlidge
f8fb99320a Embedded: Suppress spurious unused result warnings.
The results of `swift_retain(object:)` and `swift_bridgeObjectRetain(object:)`
should be discardable since it's typcial to not need the pointer returned from
these calls. Suppresses unused result warnings that were generated previously.
2025-05-18 10:40:13 -07:00
Allan Shortlidge
58af3ce541 CompatbilitySpan: Add a missing @unsafe.
The missing attribute was causing "no unsafe expressions" warnings elsewhere
when building the CompatibilitySpan library.
2025-05-18 10:37:44 -07:00
Allan Shortlidge
a85caaf296 Concurrency: Address new -strict-memory-safety warnings. 2025-05-18 10:37:19 -07:00
Anthony Latsis
6eacd233cf Merge pull request #81392 from jamieQ/patch-2
[docs][gardening]: fix typo in KeyPaths.md
2025-05-18 14:48:13 +01:00
Henrik G. Olsson
e1eb960e7f [Swiftify] Don't create safe wrapper for autoreleasing pointers (#81568)
_SwiftifyImport doesn't know how to handle
AutoreleasingUnsafeMutablePointer, so we should not attach any
.countedBy information for pointers that are imported as this type.

This also adds defensive checks against adding .countedBy to any pointer
type that _SwiftifyImport doesn't know how to transform.

rdar://151479521
2025-05-17 20:33:00 -07:00
Saleem Abdulrasool
3b968f699a CommandLineSupport: add a directive for autolinking on Windows
We use functions from Shell32.Lib. Ensure that we indicate the
autolinking to the linker. This aides when building with a static
runtime to avoid having to specify the additional library dependency for
clients that are attempting to link against the runtime. This is
particularly important for the CMake compiler check where we would need
to list Shell32 as a required link library.
2025-05-17 18:31:31 -07:00
Anthony Latsis
1823d44de7 Merge pull request #81570 from AnthonyLatsis/acer-campestri
Sema: Fix UB in `NonisolatedNonsendingByDefault` migration diagnosis
2025-05-18 01:34:52 +01:00