Commit Graph

10 Commits

Author SHA1 Message Date
Arnold Schwaighofer
1b6da50ed9 Merge pull request #85602 from aschwaighofer/wip_embedded_exit_cast
[embedded] Implement swift_dynamicCast suport for casts from existential to concrete type
2025-11-20 21:01:41 -05:00
Arnold Schwaighofer
3cff05d540 [embedded] Implement swift_dynamicCast suport for casts from existential to concrete type 2025-11-19 14:41:37 -08:00
Daniil Kovalev
a172134162 Address review comments 2025-11-18 01:46:49 +03:00
Arnold Schwaighofer
a59f6c4a3c Fix formatting 2025-10-21 07:54:55 -07:00
Arnold Schwaighofer
22c8ea6af6 Add experimental feature flag EmbeddedExistentials
This flag can be used to gradually add the functionility that will allow use of
protocol values in embedded mode.
2025-10-20 10:18:45 -07:00
Erik Eckstein
5dc71aa0a5 AST/SIL: support source location in diagnostics for de-serialized debug info
Diagnostics only work with `SourceLoc` which is basically a pointer into a buffer of the loaded source file.
But when debug info is de-serialized, the SIL `Location` consists of a filename+line+column.
To "convert" this to a `SourceLoc`, the file must be loaded.
This change adds `DiagnosticEngine.getLocationFromExternalSource` for this purpose.
Also, the new protocol `ProvidingSourceLocation` - to which `SourceLoc` and `Location` conform - help to generalize the helper struct `Diagnostic` and make this "conversion" happen automatically.
2025-05-14 11:43:47 +02:00
Erik Eckstein
be322877b1 EmbeddedSwiftDiagnostics: improve error message for non-specialized generic function calls
Tell the user if the specialization isn't done because of a dynamic Self type.

rdar://150865684
2025-05-08 19:21:08 +02:00
Erik Eckstein
f52f491936 EmbeddedSwiftDiagnostics: check apply diagnostics also for begin_apply and partial_apply 2025-05-08 19:21:08 +02:00
Erik Eckstein
d9c7a68249 EmbeddedSwiftDiagnostics: fix a wrong "cannot use co-routines (like accessors) in -no-allocations mode" error
rdar://150890424
2025-05-08 19:21:08 +02: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