Commit Graph

8 Commits

Author SHA1 Message Date
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
6b8108bf59 [cxx-interop] use SWIFT_EXTERN for Swift function prototypes
This will allow these functions to be used from C.
2022-03-13 12:11:35 -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
2c2fa566d8 [cxx-interop][test] add %check-interop-cxx-header-in-clang test command substitution to parse and validated generated C++ header in multiple C++ language modes
This ensures that we validate C++14, C++17, and C++20
2022-03-11 20:51:24 -08:00
Alex Lorenz
fcdcb2a9f1 [interop][SwiftToC++] print C++ interface for top-level Swift functions 2022-03-09 14:53:12 -08:00