Commit Graph

67 Commits

Author SHA1 Message Date
Saleem Abdulrasool
2ed5bdf01e test: enable C++ class inheritance test on Windows
Now that this test builds on Windows, we can finally unmark it as
UNSUPPORTED on windows.
2022-11-09 08:20:56 -08:00
Egor Zhdan
6ca60b075e [cxx-interop] Emit IR for virtual methods
Even if a virtual method is not used directly from Swift, it might get emitted into the vtable, and in that case the IR for it should be emitted to avoid linker errors.

Fixes https://github.com/apple/swift/issues/61730.
2022-11-01 13:10:44 -07:00
Saleem Abdulrasool
79ad745c9c test: add CxxShim import for test
This test would fail on windows when built with assertions as the
`CxxShim` module was not imported.  Add the missing import which is
required to enable this test on Windows.
2022-10-09 16:58:50 -07:00
Saleem Abdulrasool
7efe37f4c1 Update functions.swift 2022-10-08 19:44:01 -07:00
zoecarver
63c4758dad [cxx-interop] Add base classes as opaque fields when lowering in IRGen.
Much of IRGen is built around fields (example: enum packing/unpacking). This is a simpler/less bug-prone way to do it.
2022-09-20 20:20:46 -07:00
Egor Zhdan
4245bd582c Merge pull request #60389 from apple/egorzhdan/cxx-record-lookup-ext
[cxx-interop] Clang member lookup should not look into Swift extensions
2022-08-12 11:43:36 +01:00
Egor Zhdan
51a1176d90 [cxx-interop] Clang member lookup should not look into Swift extensions
Calling `NominalTypeDecl::lookupDirect` triggers deserialization of Swift extensions for the type. `ClangRecordMemberLookup` shouldn't assume it is allowed to deserialize Swift extensions for the given C++ type: there might be extensions which reference the module that is currently being imported, which causes circular request dependency errors.
2022-08-08 17:05:25 +01:00
Ehud Adler
f11e2afe07 [cxx-interop] Always import cxx shim when cxx-interop is enabled (#60336) 2022-08-05 08:28:47 -04:00
zoecarver
6acffbbee6 [cxx-interop] Flip the switch: only import safe APIs. 2022-07-18 17:15:15 -04:00
zoecarver
8cf4d3b983 [cxx-interop] Disable cxxshim on windows until we can figure out cmakeconfig. 2022-07-05 20:03:45 -07:00
zoecarver
3805828ad0 [cxx-interop] Add CxxShim library; move __swift_interopStaticCast into it. 2022-07-05 15:52:51 -07:00
Sam Kortekaas
e73bb6fd9d [cxx-interop] Import attributes on inherited C++ methods 2022-05-23 13:21:06 +02:00
zoecarver
839839f924 [cxx-interop] Rename enable-cxx-interop -> enable-experimental-cxx-interop.
Also removes the driver flag, this will now also always be guarded on `-Xfrontend`.
2022-04-07 19:15:25 -07:00
zoecarver
fc1e4df039 [cxx-interop] Empty base classes have zero offset.
Make sure empty base classes don't affect the offset of stored properties.
2022-03-03 15:47:15 -08:00
zoecarver
cc08a3124b [cxx-interop] Make sure to use the cannonical base class type. 2022-03-03 15:34:31 -08:00
zoecarver
d067f076b3 [nfc] Fix enum tests on Windows.
On windows enum's use a signed int.
2022-02-19 17:41:42 -08:00
zoecarver
bb00e8dcfe [cxx-interop] Rudimentary support for importing base classes.
This commit adds very basic support for importing and calling base class methods, getting and setting base class fields, and using types inside of base classes.
2022-02-18 15:59:52 -08:00