Commit Graph

9 Commits

Author SHA1 Message Date
Doug Gregor
74d5ee26f0 [Embedded] Downgrade type-checker error about non-final generic class methods to a warning
The existing SIL-level diagnostic for this check only triggers when
the type is actually used, while the type-checker version is more
eager. Stage in the stricter check as a warning and we'll clamp down
on things later.
2025-09-18 10:05:35 -07:00
Doug Gregor
844ba5f4f8 [Embedded] Diagnose non-final generic methods in class in the type checker
Move the diagnostic about non-final generic methods in classes up to
the type checker, so that it is available to `-Wwarning
EmbeddedRestrictions` and earlier in the pipeline. The SIL version of
this is still available as a backstop.

Yet another part of rdar://133874555.
2025-09-18 10:05:33 -07:00
Erik Eckstein
6c31eb0c43 embedded: rewrite the diagnostic pass for embedded swift
1. move embedded diagnostics out of the PerformanceDiagnostics pass. It was completely separated from the other logic in this pass, anyway.
2. rewrite it in swift
3. fix several bugs, that means: missed diagnostics, which led to IRGen crashes
  * look at all methods in witness tables, including base protocols and associated conformances
  * visit all functions in the call tree, including generic functions with class bound generic arguments
  * handle all instructions, e.g. concurrency builtins
4. improve error messages by adding meaningful call-site information. For example:
  * if the error is in a specialized function, report where the generic function is originally specialized with concrete types
  * if the error is in a protocol witness method, report where the existential is created
2025-04-18 06:58:40 +02: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
Erik Eckstein
6e61c202a7 embedded: fix a typo in an error message 2024-09-25 19:32:15 +02:00
Erik Eckstein
ba9bfaf5d5 VTableSpecializer: fix a crash for methods which have their own generic parameters
rdar://133334324
2024-08-21 17:01:35 +02:00
Kuba Mracek
f1aba675ef [embedded] Mark all embedded tests as REQUIRES: swift_in_compiler 2023-11-07 10:01:03 -08:00
zoecarver
8afe689194 [embedded] Add -wmo to a number of tests after rebase. 2023-09-15 16:50:29 -06:00
Kuba Mracek
e2de477609 [embedded] avoid metadata accessors, fix vtable map, add a diagnostic on non-final generic functions 2023-09-12 16:57:09 -07:00