Commit Graph

22 Commits

Author SHA1 Message Date
Hiroshi Yamauchi
fcc1f6b65e Fix the IR gen for C++ method calls and refactor around CGFunctionInfo
In GenCall, fix the IR gen for C++ method calls as under MSVC as the
calling conventions for free functions and C++ methods can be
different. This also fixes the missing inreg (on sret arguments)
issues on Windows ARM64. Also refactor to use CGFunctionInfo
returnInfo isSretAfterThis to detect when to reorder the sret and the
this arguments under MSVC.

In ClagImporter, don't drop the return type for the compound
assignment operators such as operator+= when the return value is a
reference so that the CGFunctionInfo will be correctly indicate an
indirect return for the compound assignment operators.
2024-10-24 15:40:21 -07:00
Saleem Abdulrasool
a3df6f64dd test: adjust tests for Windows after the rebranch
This corrects the name decoration and splits the windows and itanium
decoration schemes.  This allows us to un-XFAIL some of the interop
tests on Windows while repairing the failures identified on rebranch.
2023-09-15 11:16:11 -07:00
Arnold Schwaighofer
79894ff461 Fix test/Interop with opaque pointers 2023-07-03 03:36:07 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Alex Lorenz
9feb76419b [interop] ignore exceptions in existing interop tests 2023-02-22 11:00:51 -08:00
Ben Barham
f6d432feed [next] Generalise further interop tests
See e382e15f6a for previous test fixes -
these were xfailed at the time, so weren't updated then.
2022-06-03 11:01:19 -07:00
Ehud Adler
2422c0c111 Keep the XFAIL on windows for now 2022-05-27 15:14:52 -04:00
Ehud Adler
597668f05b Test diff mangled name for windows 2022-05-27 15:07:57 -04:00
Ehud Adler
e7fe6f0fe7 Fix tests and re-enable support for CXX operators 2022-05-21 21:28:03 -04:00
Ehud Adler
11730e8f07 Remap class operator function names (-/+/*....) to imported operator names __operator(Minus, Plus,...) and fix test cases 2022-05-18 10:31:04 -04: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
f652361af3 [cxx-interop] Remove 'support' for importing C++ operators.
This does not include subscript operators.

Before this is re-enabled operators need to be re-implemented. Right now they are the source of a lot of bugs. They cause frequent crashes and mis compiles. Also, templated operators insert a lot of names into global lookup which causes problems.

They also don't work on Windows.
2022-03-30 15:39:35 -07:00
Arnold Schwaighofer
ee6441c4d2 Fix test/Interop/Cxx 2021-08-05 12:15:23 -07:00
Puyan Lotfi
864b3a47e3 [cxx-interop] Implement operator[] for value return types (SR-14351).
This builds on top of the work of Egor Zhdan. It implements
`T operator[]` and does so largely by taking a path very much like the
`const T &operator[]` path.
2021-04-08 00:18:27 -04:00
Egor Zhdan
586c675286 C++ Interop: import subscript operators
This change adds support for calling `operator[]` from Swift code via a synthesized Swift subscript.

Fixes SR-12598.
2021-03-21 19:25:41 +03:00
Egor Zhdan
7141ae24cf C++ Interop: import call operators
This change adds support for calling `operator()` from Swift code.

As the C++ interop manifesto describes, `operator()` is imported into Swift as `callAsFunction`.
2021-03-02 21:13:57 +03:00
Arnold Schwaighofer
8242ae7458 [rebranch] Fix test/Interop/Cxx/operators tests
rdar://73591415
2021-01-26 07:48:18 -08:00
zoecarver
549189bee6 [cxx-interop] Add "nonnull" and "dereferenceable(n)" attributes to constructor params.
This reflects a change in Clang 13's codegen. Test-only fix for swift/rebranch.
2021-01-07 15:00:34 -08:00
Zoe Carver
be2f85c102 [cxx-interop] [NFC] Rename MemberInline.IntBox -> LoadableIntWrapper. (#33930) 2020-09-24 20:08:19 -07:00
zoecarver
d647794ac0 [cxx-interop] Replace inline member "operator+" with "operator-".
Adding integers is a commutative operation meaning the old tests would
fail to detect an error if the arguments were passed in the wrong order.
Testing inline member operators using subtraction ensures that arguments
are passed in the correct order.
2020-09-08 21:09:43 -07:00
Michael Forster
a443327efe Add bug reference to XFAIL operator tests 2020-07-03 11:16:06 +02:00
Michael Forster
26358c4588 Import member operator functions as static members (#32293)
This adds support to `ClangImporter` to import C++ member function operators as static methods into Swift, which is part of SR-12748.

The left-hand-side operand, which gets passed as the `this` pointer to the C++ function is represented as an additional first parameter in the Swift method. It gets mapped back in SILGen.

Two of the tests are disabled on Windows because we can't yet call member functions correctly on Windows (SR-13129).
2020-07-03 11:06:22 +02:00