Commit Graph

171 Commits

Author SHA1 Message Date
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
ef5d11aab8 [interop][SwiftToCxx] NFC, Make swift::getTypeMetadata accessor part of struct template
This allows partial template specializations for adding metadata accessor for generic types 🤩
2022-08-31 17:16:45 -07:00
Alex Lorenz
4154b56745 [interop][SwiftToCxx] unify generic function printing with generic struct printing
This is a pre-requisite for supporting methods in generic structs.
2022-08-31 15:31:04 -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
942523f3df [interop][SwiftToCxx] NFC, refactor full _impl type printer into a function 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
8214b85f6b Merge pull request #60842 from WANGJIEKE/cxx-interop-enum-creation
[Interop][SwiftToCxx] Support enum creation from Cxx
2022-08-31 14:00:50 -07:00
Doug Gregor
28644db815 Merge pull request #60851 from DougGregor/print-cxx-sugared-types
[Print as C++] Don't crash on sugared types
2022-08-30 22:52:47 -07:00
Roberto Rosmaninho
9ebc0bd26e [SwiftToCxx] Trowing Swift::Error instead of NaiveException 2022-08-30 16:25:17 -03:00
Doug Gregor
413fb37b70 [Print as C++] Don't crash on sugared types 2022-08-30 11:01:51 -07:00
Roberto Rosmaninho
ec10c5f5e6 [SwiftToCxx] Adding _Nullable to avoid warnings 2022-08-30 14:15:45 -03:00
Tongjie Wang
cbc23cbafc [Interop][SwiftToCxx] Support enum creation from Cxx 2022-08-29 20:16:52 -07:00
Alex Lorenz
a89d4f3ced [interop][SwiftToCxx] add support for generic methods 2022-08-29 14:11:33 -07:00
Alex Lorenz
c08428cd56 [interop][SwiftToCxx] do not support generics with requirements for now 2022-08-29 12:14:33 -07:00
Alex Lorenz
7bf7642d51 [interop][SwiftToCxx] support @_expose attribute on initializers 2022-08-29 07:41:49 -07:00
Alex Lorenz
288e4cb566 [interop][SwiftToCxx] do not emit functions/methods that use unexposed types 2022-08-25 15:09:26 -07:00
Alex Lorenz
8de79390be [interop][SwiftToCxx] add @_expose(Cxx) attribute support
This attribute instructs the compiler that this declaration should be included in the generated C++ bindings
2022-08-24 10:14:07 -07:00
Alex Lorenz
d4a7f86e3d [interop][SwiftToCxx] do not emit unsupported function signatures yet 2022-08-16 14:39:22 -07:00
Alex Lorenz
f371c4307b [interop][SwiftToCxx] pass boxed resilient value types to generic functions correctly 2022-08-09 14:16:58 -07:00
Alex Lorenz
330fc0b07a [interop][SwiftToCxx] generic functions should return value types correctly 2022-08-09 05:20:58 -07:00
Alex Lorenz
7ecf84a771 [interop][SwiftToCxx] ensure that resilient class values are supported 2022-08-08 13:08:54 -07:00
Alex Lorenz
bb7ba7c7ce Merge pull request #60442 from hyp/eng/generic-class
[interop][SwiftToCxx] add support for passing and returning class val…
2022-08-08 13:06:46 -07:00
Alex Lorenz
a9f262e322 [interop][SwiftToCxx] add support for passing and returning class values to generic functions 2022-08-08 08:38:28 -07:00
Alex Lorenz
7eefb30cb1 [interop][SwiftToCxx] emit property accessors in class types correctly
property accessors could potentially mutate the class instance, so don't make them const
2022-08-03 13:12:51 +01:00
Alex Lorenz
c0bda0617a [interop][SwiftToCxx] emit class method bindings 2022-08-03 13:03:45 +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
Alex Lorenz
af32bbf8f3 [interop][SwiftToCxx] generics: add support for returning primitive generic types 2022-08-01 10:28:03 +01:00
Alex Lorenz
ea9276fb60 Merge pull request #60298 from hyp/i/gen/inout
[interop][SwiftToCxx] generics: support inOut generic param
2022-08-01 08:31:20 +01:00
Tongjie Wang
19c7d79540 Add missing pointer nullability annotation for inout function 2022-07-29 02:29:15 -07:00
Alex Lorenz
c31b6cfb0c [interop][SwiftToCxx] generics: support inOut generic param 2022-07-29 09:15:40 +01:00
Alex Lorenz
32723f7e67 [interop][SwiftToCxx] initial generic function support: pass generic parameters
Only primitive types are supported at the moment from C++ as the type traits aren't emitted for all types yet
2022-07-28 22:52:21 +01:00
Alex Lorenz
8da01aa0f1 Merge pull request #60087 from WANGJIEKE/cxx-interop-extract-enum-payload
[Interop][SwiftToCxx] Initial support for getting associated values from enum
2022-07-28 12:06:44 +01:00
Alex Lorenz
0edddde7ae [interop][SwiftToCxx] Add inout support for UnsafePointer/UnsafeMutablePointer param types 2022-07-26 15:39:29 +01:00
Alex Lorenz
9a80d78263 [interop][SwiftToCxx] pass and return UnsafePointer/UnsafeMutablePointer types 2022-07-26 15:30:14 +01:00
Alex Lorenz
3b4c6bffd8 [interop][SwiftToCxx] remap bool is/has property getters directly as is/has methods in C++ 2022-07-26 14:34:40 +01:00
Alex Lorenz
c9bd89b115 [interop][SwiftToCxx] NFC, extract code to remap a property name to its own function 2022-07-26 14:21:30 +01:00
Alex Lorenz
760d59e8e1 [interop][SwiftToCxx] NFC, use FunctionSignatureModifiers to print 'static' 2022-07-26 14:20:30 +01:00
Alex Lorenz
5aafe4599c [interop][SwiftToCxx] NFC, use FunctionSignatureModifiers to print 'inline' 2022-07-26 14:08:09 +01:00
Alex Lorenz
6f86d60e54 [interop][SwiftToCxx] NFC, use FunctionSignatureModifiers to print 'const' 2022-07-26 14:04:23 +01:00
Alex Lorenz
7e0c2a987d Merge pull request #60079 from Robertorosmaninho/cxx-interop/SwiftToCxxErrorHandling
[Interop] [SwiftToCxx] Implementing a naive exception to be thrown in C++ if an Error is thrown in Swift
2022-07-20 15:54:48 +01:00
Tongjie Wang
290e527b0b [Interop][SwiftToCxx] Initial support for getting associated values from enum
improve test cases

add support for primitive types
2022-07-18 18:19:00 -07:00
Alex Lorenz
23ed6e8c9f [interop][SwiftToCxx] support instance property setters in C++ 2022-07-18 17:49:51 +01:00
Roberto Rosmaninho
b15c6a5537 Implementing a naive exception to be thrown in C++ if an Error is thrown in Swift
Creating new Interop - SwiftToCxx test
2022-07-15 20:14:13 -03:00
Alex Lorenz
88c55c1778 [interop][SwiftToCxx] add support for passing/returning value types from other modules 2022-07-15 17:14:35 +01:00