Commit Graph

15 Commits

Author SHA1 Message Date
Becca Royal-Gordon
da07ff577c [PrintAsClang] Warn about unstable decl order
PrintAsClang is supposed to emit declarations in the same order regardless of the compiler’s internal state, but we have repeatedly found that our current criteria are inadequate, resulting in non-functionality-affecting changes to generated header content. Add a diagnostic that’s emitted when this happens soliciting a bug report.

Since there *should* be no cases where the compiler fails to order declarations, this diagnostic is never actually emitted. Instead, we test this change by enabling `-verify` on nearly all PrintAsClang tests to make sure they are unaffected.

This did demonstrate a missing criterion that only mattered in C++ mode: extensions that varied only in their generic signature were not sorted stably. Add a sort criterion for this.
2025-02-14 21:41:36 -08:00
Alex Lorenz
3a9b6dce9d [interop][SwiftToCxx] add support for emitting Swift stdlib dependency in one header file
This is the default behavior. You can disable this by specifying the -clang-header-expose-decls= flag explicitly when generating the header
2022-09-28 08:08:48 -07:00
Alex Lorenz
1696f94223 [interop][SwiftToCxx] reimplement function lowering to correctly distinguish between direct/indirect return values and parameters 2022-09-07 11:43:38 -07:00
Alex Lorenz
3e4b52c42a [interop][SwiftToCxx] add support for generic methods in generic structs ♺ 2022-09-01 13:01:26 -07:00
Alex Lorenz
6e8b0be181 [interop][SwiftToCxx] add test to cover initializer in generic struct 2022-09-01 12:35:51 -07:00
Alex Lorenz
d9f4c072cc [interop][SwiftToCxx] correctly invoke property accessors in generic structs 2022-09-01 06:57:49 -07:00
Alex Lorenz
a5043c354d [interop][SwiftToCxx] add support for invoking methods in generic structs 2022-08-31 20:19:19 -07:00
Alex Lorenz
f89f64a5cb [interop][SwiftToCxx] add support for passing generic structs with concrete type params 2022-08-31 14:02:17 -07:00
Alex Lorenz
031b779031 [interop][SwiftToCxx] add support for returning generic types bounded to concrete generic params 2022-08-31 14:02:17 -07:00
Alex Lorenz
c526ac8a0d [interop][SwiftToCxx] add 'inout' support for passing generic struct 2022-08-31 14:02:17 -07:00
Alex Lorenz
7012efd2cd [interop][SwiftToCxx] add a testcase for generic struct passthrough 2022-08-31 14:02:17 -07:00
Alex Lorenz
9f26709ffc [interop][SwiftToCxx] cleanup generic struct tests 2022-08-31 14:02:17 -07:00
Alex Lorenz
7d6cdbc445 [interop][SwiftToCxx] pass generic type to a function by value (non specialized generic though) 2022-08-31 14:02:17 -07:00
Alex Lorenz
ebd8dea0fd [interop][SwiftToCxx] return generic structs without concrete type specialization 2022-08-31 14:02:17 -07:00
Alex Lorenz
45d209fe1c [interop][SwiftToCxx] initial generic struct support 2022-08-31 14:02:15 -07:00