Commit Graph

18 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
588a35195d [interop][SwiftToCxx] fix a CHECK line in string-to-nsstring.mm
rdar://118139534
2023-11-09 13:42:45 -08:00
Alex Lorenz
c41774188c [interop][SwiftToCxx] add swift::String overlay constructor for constructing it directly from a C string literal
resolves https://github.com/apple/swift/issues/63448
2023-05-05 06:29:59 -07:00
Alex Lorenz
f405fb0fa8 [interop][SwiftToCxx] do not expose @alwaysEmitIntoClient properties to C++ 2023-03-15 10:01:37 -07:00
Alex Lorenz
0dc90d38c1 [interop][SwiftToCxx] emit Swift's stdlib inside of 'swift' namespace 2023-03-09 17:32:43 -08:00
Alex Lorenz
3adf16eb28 Merge pull request #64083 from hyp/eng/api-stdlib-arg-labels
[interop][SwiftToCxx] incorporate argument labels into Stdlib API nam…
2023-03-03 21:37:40 -08:00
Alex Lorenz
13a63f4b05 [interop][SwiftToCxx] incorporate argument labels into Stdlib API names in C++
This allows easier use and more wider API exposure from the Swift stdlib

In the future, all functions and method should incorporate argument labels, but it's not yet clear how
2023-03-03 14:15:48 -08:00
swift-ci
efb80004f1 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-15 14:33:36 -08:00
Alex Lorenz
28af8bef55 [interop][SwiftToCxx] make it possible to convert Swift String to a std::string in C++
This is done by exposing nested Index and UTF8View type in String. Nested types aren't
supported yet, so we need to employ a number of hacks to emit them.
2022-12-14 16:22:41 -08:00
swift-ci
8df84bd87a Merge remote-tracking branch 'origin/main' into rebranch 2022-12-13 20:54:17 -08:00
Alex Lorenz
5c703b4f5c [interop][SwiftToCxx] support std::string -> Swift::String conversion in C++ 2022-12-13 13:13:05 -08:00
Erik Eckstein
d89c6b2d70 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-01 07:48:51 +01:00
Alex Lorenz
cd67584015 [interop][SwiftToCxx] support NSString -> Swift String bridging in C++ 2022-11-29 16:52:50 -08:00
Alex Lorenz
83db71b64e [interop][SwiftToCxx] use the more appropriate String -> NSString bridging invocation
This fixes some CI failures
2022-11-29 15:19:26 -08:00
Erik Eckstein
f811676220 rebranch: some test fixes 2022-11-09 18:26:26 +01: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
1d164039b1 [interop][SwiftToCxx] experimentally expose Swift's Array type
This is done without annotations on the stdlib yet while @_expose is still experimental
2022-09-08 11:04:03 -07:00
Alex Lorenz
06d9fd24d4 [interop][SwiftToCxx] add experimental Swift::String -> NSString conversion operator 2022-08-25 15:09:30 -07:00