Alex Lorenz
567bb850cc
[interop][SwiftToCxx] add _SwiftCxxInteroperability.h shims header and import it for C++ header mode
2022-07-29 08:54:27 +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
32f2b71fdf
[interop][SwiftToCxx] include <new> after <stdlib.h> (fixes local tests)
2022-07-28 20:43:36 +01:00
Tongjie Wang
5b2c6e5b53
use placement new so we don't destory an enum twice
2022-07-25 08:27:19 -07:00
Roberto Rosmaninho
ff222acebc
Setting hardcode SWIFT_NOEXCEPT and noexcept flags only to
...
non-throwing functions.
Activating swift-functions-errors tests
Inserting macros and additional parameters in C and C++ functions following the pattern to lowering to LLVM IR.
2022-07-14 12:34:53 -03:00
Alex Lorenz
b8ee625f77
[interop][SwiftToCxx] fix aligned allocation refs
2022-06-16 14:14:40 -07:00
Alex Lorenz
61e484c410
[interop][SwiftToCxx] correctly align allocation for opaque Swift value
2022-06-15 21:47:39 -07:00
Alex Lorenz
d7fd1233a9
[interop][SwiftToCxx] emit instance property getters for structs
2022-06-14 17:20:37 -07:00
Alex Lorenz
f9aa02bbf6
[interop][SwiftToCxx] fix the source compat failures
2022-06-14 07:15:03 -07:00
Alex Lorenz
a65ddbe997
[interop][SwiftToCxx] print out value witness table definition in swift::_impl
2022-06-13 14:26:25 -07:00
Alex Lorenz
132729906c
[interop][SwiftToCxx] pass / return Swift struct values between C/C++ and Swift
2022-06-08 07:03:24 -07:00
Alex Lorenz
42c6ff63b8
[interop][SwiftToCxx] Gather initial struct layout information and emit struct stubs with storage in C++
...
This change extends the clang header printer to start emitting C++ classes for Swift struct types with the correct struct layout in them (size + alignment)
2022-06-01 14:06:25 -07:00
Alex Lorenz
f7902a6095
[cxx-interop] Emit C++ inline function thunks that with correct primitive types
2022-03-29 13:37:01 -07:00
Alex Lorenz
80bc75ab9b
[cxx-interop] Emit C++ declarations only when '-clang-header-expose-public-decl' is enabled
...
This fix also ensures that we only emit C++ functions for now
2022-03-20 20:22:02 -07:00
Alex Lorenz
2e3aa87737
Revert "Revert "Merge pull request #41831 from hyp/unify-header""
...
This reverts commit 4c9582c295 .
2022-03-19 13:36:28 -07:00
Alex Lorenz
4c9582c295
Revert "Merge pull request #41831 from hyp/unify-header"
...
This reverts commit cd93d23bac , reversing
changes made to f9f5476e9a .
2022-03-18 10:03:07 -07:00
Alex Lorenz
9d52099d5b
[cxx-interop] start to emitting a unified header file for a Swift module
...
This change removes the -emit-cxx-header option, and adds a new -emit-clang-header-path option instead. It's aliased to -emit-objc-header-path for now, but in the future, -emit-objc-header-path will alias to it. After this change Swift can start emitting a single header file that can be expose declarations to C, Objective-C, or C++. For now C++ interface is generated (for all public decls) only when -enable-cxx-interop flag is passed, but that behavior will change once attribute is supported.
2022-03-17 10:34:47 -07:00
Alex Lorenz
23e56e314c
[cxx-interop] add OBJC and cplusplus conditions for emitted header includes
...
This will allow us to generate a unified clang header.
2022-03-15 12:34:27 -07:00
Alex Lorenz
858a847d27
[cxx-interop] use SWIFT_NOEXCEPT for Swift function prototypes
...
This will allow these functions to be used from C.
Also add a static_assert to verify that noexcept is actually used.
2022-03-13 11:08:32 -07:00
Alex Lorenz
fcdcb2a9f1
[interop][SwiftToC++] print C++ interface for top-level Swift functions
2022-03-09 14:53:12 -08:00
Alex Lorenz
54b466f983
[interop] emit a parsable C++ header for a module that includes namespace declaration for the module interface
2022-01-21 07:14:56 -08:00
Alex Lorenz
e106551028
[NFC][interop] rename the PrintAsObjC library to PrintAsClang
...
We're starting to support emission of C++ header interfaces, so a language-agnostic name makes more sense
2022-01-20 11:31:58 -08:00