Commit Graph

685 Commits

Author SHA1 Message Date
Erik Eckstein
5b93eb31bf Optimizer: remove the AllocVectorLowering pass
It's not needed anymore, because the "FixedArray" experimental feature is replaced by inline-arrays.
2025-02-12 10:51:14 +01:00
Kuba (Brecka) Mracek
63b2f58d9e Merge pull request #79242 from kubamracek/embedded-mergeable-symbols
[embedded] Add an experimental -Xfrontend -mergeable-symbols to allow linking multiple .o modules in Embedded Swift
2025-02-10 15:17:05 -08:00
Allan Shortlidge
022596473f Merge pull request #79248 from tshortli/abi-compatible-platform-decl-reachability
AST: Platform-specific fixes for `-unavailable-decl-optimization`
2025-02-09 16:53:59 -08:00
Kuba (Brecka) Mracek
31af4d9ed5 Merge pull request #79243 from kubamracek/embedded-currenttask
[embedded] Add a test for withUnsafeCurrentTask
2025-02-09 16:04:20 -08:00
Allan Shortlidge
b9e1cbd3ac AST: Enable -unavailable-decl-optimization on visionOS.
Using availability domains, reimplement the algorithm that determines whether a
declaration is unavailable at runtime. The new algorithm takes ABI compatible
platforms into account, ensuring that declarations that are available on iOS do
not get treated as unreachable at runtime when compiling for visionOS.

Resolves rdar://116742214.
2025-02-09 11:19:08 -08:00
Allan Shortlidge
e47638940e AST: Introduce swift::getAvailabilityConstraintsForDecl().
This new query is designed to become the canonical source of information
regarding whether a declaration is available to use in a given
`AvailabilityContext`. It should be adopted as the foundational building block
for all other queries that answer more specific questions about the
availability of a specific delcaration.

The implementation of this query has been copied from a variety of sources
which should eventually be deleted once the new query has been fully adopted.

NFC.
2025-02-08 22:47:01 -08:00
Kuba Mracek
0d814ceb81 [embedded] Add a test for withUnsafeCurrentTask 2025-02-08 13:36:26 -08:00
Kuba Mracek
b2f87e7614 [embedded] Add an experimental -Xfrontend -mergeable-symbols to allow linking multiple .o modules in Embedded Swift 2025-02-08 11:56:09 -08:00
Kuba (Brecka) Mracek
96862b4bb0 Merge pull request #79082 from swiftlang/revert-78986-embedded-api-descriptor
Revert "[embedded] Don't emit extensions to API descriptor under Embedded Swift, avoid compiler crash"
2025-01-31 16:59:23 -08:00
Kuba (Brecka) Mracek
3afe8ebdf6 Merge pull request #78919 from kubamracek/embedded-dict-init
[embedded] Support Dictionary.init(uniqueKeysWithValues:) in Embedded Swift
2025-01-31 11:03:04 -08:00
Kuba (Brecka) Mracek
7d257c9a05 Revert "[embedded] Don't emit extensions to API descriptor under Embedded Swift, avoid compiler crash" 2025-01-31 11:01:52 -08:00
Kuba (Brecka) Mracek
fd9777e500 Merge pull request #78986 from kubamracek/embedded-api-descriptor
[embedded] Don't emit extensions to API descriptor under Embedded Swift, avoid compiler crash
2025-01-31 11:01:45 -08:00
Kuba Mracek
6d31a8b7b0 [embedded] Restrict test/embedded/dict-init.swift to macOS only 2025-01-30 09:16:39 -08:00
Kuba (Brecka) Mracek
7c685ba36b Merge pull request #78915 from kubamracek/embedded-string-switch-with-cache
[embedded] Support _findStringSwitchCaseWithCache in Embedded Swift
2025-01-28 15:56:22 -08:00
Kuba Mracek
fcc851b5c8 [embedded] Adjust test/embedded/api-descriptor-crash.swift for Linux mangling 2025-01-28 13:42:18 -08:00
Kuba (Brecka) Mracek
53921e4c8c Merge pull request #78920 from kubamracek/embedded-wae
[embedded] Support withoutActuallyEscaping in Embedded Swift
2025-01-28 12:32:48 -08:00
Kuba Mracek
636c82dfda [embedded] Don't emit extensions to API descriptor under Embedded Swift, avoid compiler crash 2025-01-28 11:13:57 -08:00
Erik Eckstein
3e4a4d62ed embedded: make sure to serialize vtable methods with the right linkage
In embedded mode CrossModuleOptimization must visit all vtable methods to make sure that no private/internal methods are serialized.

Fixes a compiler crash
rdar://143153941
2025-01-28 11:19:35 +01:00
Kuba Mracek
4da68126eb [embedded] Mark test/embedded/without-actually-escaping.swift as REQUIRES: swift_test_mode_optimize_none 2025-01-27 10:15:45 -08:00
Kuba Mracek
8e3ee38324 [embedded] Support withoutActuallyEscaping in Embedded Swift 2025-01-25 15:24:20 -08:00
Kuba Mracek
c99e9e4922 [embedded] Support Dictionary.init(uniqueKeysWithValues:) in Embedded Swift 2025-01-25 14:55:19 -08:00
Kuba Mracek
92b0c5f5d0 [embedded] Support _findStringSwitchCaseWithCache in Embedded Swift 2025-01-25 09:09:47 -08:00
Allan Shortlidge
fe138e014a AST: Track an unavailable domain instead of platform in AvailabilityContext.
Now that most of the compiler tracks availability in terms of
AvailabilityDomain, it's time to do so in AvailabilityContext as well. This
will ensure that the compiler accurately suppresses diagnostics about a decl
being unavailable in an arbitrary domain when the context of the use is already
unavailable in that domain.

With this change, most of the special-casing for the Embedded Swift availability
domain has been removed from the compiler, outside of parsing and interface
printing.
2025-01-22 06:40:11 -08:00
Kuba (Brecka) Mracek
8d3b0d0e8c Merge pull request #78779 from kubamracek/embeddded-arm64e-none-macho-requires-cc
[embedded] Mark test/embedded/ptrauth-none-macho.swift as REQUIRES: embedded_stdlib_cross_compiling
2025-01-21 23:18:23 -08:00
Kuba (Brecka) Mracek
0a081f8cd3 Merge pull request #78748 from kubamracek/embedded-centralize-test-os-filter
[embedded] Centralize the OS/target requirements on (most) Embedded Swift tests
2025-01-21 15:14:47 -08:00
Kuba Mracek
2542bc4495 [embedded] Mark test/embedded/ptrauth-none-macho.swift as REQUIRES: embedded_stdlib_cross_compiling 2025-01-21 09:40:28 -08:00
Alejandro Alonso
11fbd94668 Merge pull request #78664 from Azoy/unicode-16
[stdlib] Unicode 16
2025-01-21 09:29:35 -08:00
Kuba Mracek
d8c0c25b4b [embedded] Centralize the OS/target requirements on (most) Embedded Swift tests 2025-01-19 11:44:55 -08:00
Kuba (Brecka) Mracek
7f5686d5ff Merge pull request #78613 from kubamracek/embedded-arm64e-none-macho
[embedded] Add a test for arm64e ptrauth using -none-macho triple
2025-01-18 20:44:58 -08:00
Alejandro Alonso
69f6df024d Remove consonant check 2025-01-17 17:46:14 -08:00
Alejandro Alonso
29378d3132 Update embedded unicode dead strip test v2 2025-01-16 16:08:25 -08:00
Alejandro Alonso
6d5acec493 Update embedded dead strip tests 2025-01-16 13:36:50 -08:00
Kuba Mracek
4110b390e9 [embedded] Add a test for arm64e ptrauth using -none-macho triple 2025-01-13 11:59:49 -08:00
Erik Eckstein
cc308c97cf embedded: make sure to generate witness tables which are imported from other modules
In embedded swift all the code is generated in the top-level module.
De-serialized witness tables for class existentials must be code-gen'd and therefore made non-external.

Fixes an unresolved symbol linker error.
rdar://142561676
2025-01-13 14:08:35 +01:00
Arnold Schwaighofer
c7b343d603 Disable this test on anything but macOS
Attempting to unblock bots

Specifically, this also seems to fail on PR tests:

```
Failed Tests (1):
  Swift(iphonesimulator-x86_64) :: embedded/wrong-linkage.swift
```

rdar://142601111
2025-01-09 14:17:02 -08:00
Erik Eckstein
67b8c08ef1 SILLinker: convert an assert to a compiler error message
Having a wrong linkage can happen if the user "re-defines" an existing function with a wrong linkage, e.g. using `@_cdecl`.
2025-01-08 11:00:27 +01:00
Kuba Mracek
054527731e [embedded] Add test/embedded/availability-macos.swift 2024-12-18 13:46:36 -08:00
Kuba (Brecka) Mracek
0bbaa3519b Merge pull request #78100 from kubamracek/embedded-no-metadata-cxx
[embedded] Don't emit metadata references from C++ interop
2024-12-12 21:14:52 -08:00
Kuba (Brecka) Mracek
7946bf7840 Merge pull request #78147 from kubamracek/embedded-cxxshim
[embedded] Include and use cxxshims in the embedded/ resource dir
2024-12-12 20:36:56 -08:00
Kuba Mracek
77c6494cdb [embedded] Add test/embedded/cxx-no-metadata.swift testcase 2024-12-12 15:32:24 -08:00
Kuba Mracek
3aeb5e9289 [embedded] Add missing 'REQUIRES' into test/embedded/cxxshim.swift 2024-12-12 15:30:50 -08:00
Kuba Mracek
85a4f18dcd [embedded] Add test/embedded/cxxshim.swift testcase 2024-12-12 12:17:55 -08:00
Kuba Mracek
1952449d64 [embedded] Test changes for new Embedded Swift mangling prefix 2024-12-03 09:10:45 -08:00
Erik Eckstein
7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00
Kuba (Brecka) Mracek
3fdec2171f Merge pull request #77657 from kubamracek/embedded-more-stdlib
[embedded] Add back lazy collection operations, collection diffing and StaticBigInt to Embedded Stdlib
2024-11-19 15:03:31 -08:00
Erik Eckstein
4241a2cbfd embedded: Don't emit SILProperties in embedded swift
SILProperties are only needed for resilient builds.

Fixes a crash in IRGen
https://github.com/swiftlang/swift/issues/77682
2024-11-19 10:10:56 +01:00
Kuba Mracek
cf75741ad6 [embedded] Restrict test/embedded/collection-difference.swift to just macOS 2024-11-16 08:29:51 -08:00
Kuba Mracek
0d4f91f271 [embedded] Add back lazy collection operations, collection diffing and StaticBigInt to Embedded Stdlib 2024-11-16 08:16:57 -08:00
Kuba Mracek
b370050dd0 [embedded] Enable integer parsing in Embedded Swift 2024-11-13 11:52:37 -08:00
Kuba Mracek
b197db88b0 [ConstExpr] Relax expectations in ArrayAppendElement to allow direct-passed element 2024-11-08 14:37:15 -08:00