Commit Graph

8 Commits

Author SHA1 Message Date
Egor Zhdan
b440c4ff70 [cxx-interop] Enable reference-counted types on Windows
This enables the use of reference-counted foreign reference types on Windows. As it turns out, the assertion that was failing on Windows previously was unnecessary. This also enabled many of the tests on Windows.

rdar://154694125 / resolves https://github.com/swiftlang/swift/issues/82643
2025-08-20 12:35:10 +01:00
Egor Zhdan
9178af3ec7 [cxx-interop] Enable foreign reference types in C interop
Most of the logic for C++ foreign reference types can be applied to C types as well. Swift had a compiler flag `-Xfrontend -experimental-c-foreign-reference-types` for awhile now which enables foreign reference types without having to enable C++ interop. This change makes it the default behavior.

Since we don't expect anyone to pass `experimental-c-foreign-reference-types` currently, this also removes the frontend flag.

rdar://150308819
2025-07-01 18:46:22 +01:00
Erik Eckstein
ba4081ee76 Optimizer: replace PredictableMemoryAccessOptimizations with MandatoryRedundantLoadElimination in the pass pipeline
PredictableMemoryAccessOptimizations has become unmaintainable as-is.
RedundantLoadElimination does (almost) the same thing as PredictableMemoryAccessOptimizations.
It's not as powerful but good enough because PredictableMemoryAccessOptimizations is actually only needed for promoting integer values for mandatory constant propagation.
And most importantly: RedundantLoadElimination does not insert additional copies which was a big problem in PredictableMemoryAccessOptimizations.

Fixes rdar://142814676
2025-02-07 11:30:35 +01:00
Egor Zhdan
8610974cba [cxx-interop] Re-enable a test for C foreign reference types
This test has been disabled since 2022.

This re-enables the test in order to have  some test coverage of the `-experimental-c-foreign-reference-types` compiler flag.

See `test/Interop/Cxx/foreign-reference/reference-counted.swift` for a very similar test that enables C++ interop.

rdar://101790203
2024-09-24 13:00:36 +01:00
Zoe Carver
ae7466f699 Merge pull request #61895 from zoecarver/add-flag-for-c-frt
Put C foreign refernece types behind a flag.
2022-11-03 13:54:01 -07:00
zoecarver
bf652b6f31 Put C foreign refernece types behind a flag. 2022-11-02 17:08:31 -07:00
zoecarver
448d16a9f0 [nfc] XFAIL Interop/C/foreign-reference.swift on rdar://101790203. 2022-11-02 13:49:07 -07:00
zoecarver
dc581b9d58 Support foreign reference types when C++ interop is disabled. 2022-10-26 14:50:09 -07:00