Commit Graph

14 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
9d7460f130 [interop][SwiftToCxx] NFC, add missing include to swift-class-execution.cpp test 2023-05-08 06:54:57 -07:00
Alex Lorenz
f0967a4af1 Revert "Disable test/Interop/SwiftToCxx/class/swift-class-execution.cpp"
This reverts commit 5ce8b6cb06.
2023-05-08 06:54:47 -07:00
Arnold Schwaighofer
5ce8b6cb06 Disable test/Interop/SwiftToCxx/class/swift-class-execution.cpp
It failed on a package bot.
https://ci.swift.org/job/oss-swift-package-ubi-9/506/consoleText
rdar://109037144
2023-05-08 06:38:31 -07:00
Alex Lorenz
16b1fe173f [interop][SwiftToCxx] moving a Swift class in C++ performs a copy
C++ does not have a consuming move, so fallback to copy instead

Resolves https://github.com/apple/swift/issues/64702
2023-05-07 08:55:20 -07:00
Nate Chandler
90f7af22c9 [SILOpt] Run DestroyAddrHoisting in mandatory.
Run DestroyAddrHoisting in the pipeline where DestroyHoisting was
previously running.  Avoid extra ARC traffic that having no form of
destroy hoisting in the mandatory pipeline results in.

rdar://90495704
2023-04-04 11:11:34 -07: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
7ecf84a771 [interop][SwiftToCxx] ensure that resilient class values are supported 2022-08-08 13:08:54 -07:00
Alex Lorenz
478987b54e [interop][SwiftToCxx] expose getOpaquePointer class pointer accessors via swift helper class in shims header 2022-08-02 20:15:10 +01:00
Alex Lorenz
c332a90a8a [interop][SwiftToCxx] retain & release class values when a C++ class reference is copy assigned 2022-08-02 17:52:49 +01:00
Alex Lorenz
e289865861 [interop][SwiftToCxx] retain class values when a C++ class reference is copy constructed 2022-08-02 17:34:21 +01:00
Alex Lorenz
e1d812a848 [interop][SwiftToCxx] pass class parameter types by 'inout' 2022-08-02 16:48:12 +01:00
Alex Lorenz
51c0a3ff05 [interop][SwiftToCxx] add support for passing class types to Swift functions 2022-08-02 15:22:16 +01:00
Alex Lorenz
26d55a2b83 [interop][SwiftToCxx] start emitting bindings for Swift class types
This includes release on destruction, and correctly returning class values from Swift to C++.
2022-08-02 09:25:35 +01:00