Commit Graph

12 Commits

Author SHA1 Message Date
Doug Gregor aad51cab01 [Embedded] Remove the ability to disable existentials in Embedded Swift
Support for existentials in Embedded Swift has been available for a
little while now and appears to be solid. Remove the ability to disable
them (via `-disable-experimental-feature EmbeddedExistentials`), both
because it simplifies the code and because it's an ABI break to
disable the feature.
2026-04-17 17:38:01 -07:00
Arnold Schwaighofer 3dd5286d48 [embedded] [IRGen] Avoid creating "aliases" for type metadata address points in client modules
We don't need to export the type metadata address point alias in clients that
lazily emit other module's type metadata. There will be an exported
metadata symbol in the originating module for that purpose.

Instead, satisfy any local uses of the metadata address point uses by its
underlying address computation.

This is to workaround a bug where LLVM generates the wrong assembly for
weak aliases that point to an offset of another symbol.

```
@"$e1C7MyClassCySiGN" = weak_odr hidden alias %swift.type, getelementptr
inbounds (<{ ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }>,
ptr @"$e1C7MyClassCySiGMf", i32 0, i32 1)
```

Generates:

```
.weak_reference _$e1C7MyClassCySiGN
.private_extern _$e1C7MyClassCySiGN
.alt_entry  _$e1C7MyClassCySiGN
  _$e1C7MyClassCySiGN = _$e1C7MyClassCySiGMf+8
```

Instead of

```
.weak_definition _$e1C7MyClassCySiGN
.private_extern _$e1C7MyClassCySiGN
.alt_entry  _$e1C7MyClassCySiGN
  _$e1C7MyClassCySiGN = _$e1C7MyClassCySiGMf+8
```

Leading for "weak"ness to be ignored and duplicate type medata symbol linkage
errors.

rdar://169573918
2026-02-06 12:24:08 -08:00
Arnold Schwaighofer bd7d724c89 [embedded] Replace custom -disable-embedded-existentials logic in favor of standard Feature handling mechanism 2025-12-22 14:11:46 -08:00
Arnold Schwaighofer 139b648db9 Fix some tests for ptrauth
rdar://166693012
2025-12-18 08:54:56 -08:00
Arnold Schwaighofer d019f37b68 [embedded] Enable support for existentials/boxed protocol types per default
And enable this feature in production.
2025-12-10 08:50:23 -08:00
Erik Eckstein 45b1a21e74 Optimizer: make ModulePassContext.specialize() also available in FunctionPassContext and add two argument flags
add `convertIndirectToDirect` and `isMandatory`
2025-09-04 08:15:45 +02:00
Kuba Mracek d8c0c25b4b [embedded] Centralize the OS/target requirements on (most) Embedded Swift tests 2025-01-19 11:44:55 -08:00
Kuba Mracek 1952449d64 [embedded] Test changes for new Embedded Swift mangling prefix 2024-12-03 09:10:45 -08:00
Daniel Rodríguez Troitiño ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Kuba Mracek b8bd832fba [embedded] Add IVarDestroyers into class metadata, add support for throws in initializers 2024-03-26 20:52:17 -07:00
Erik Eckstein fec426fcb0 tests: fix check lines in embedded/managed-buffer.swift test
rdar://123810417
2024-02-29 10:00:51 +01:00
Erik Eckstein 75e2f363a0 embedded stdlib: make the ManagedBuffer initializer public in the embedded stdlib
Otherwise derived classes cannot be specialized.

Fixes a compile time error when using ManagedBuffer in embedded mode.
rdar://122414669
2024-02-14 09:51:43 +01:00