Nate Chandler
ed623d7b64
[NFC] Shortened SIL [init] flag.
...
Instead of writing out [initalization] for some instructions, use [init]
everywhere.
2022-10-27 10:38:54 -07:00
Mike Pinkerton
5c6348c6ce
Test various nodiscard return cases.
2022-10-25 11:03:06 -04:00
Egor Zhdan
49405aaedb
Merge pull request #61638 from apple/egorzhdan/cxx-destructor-irgen
...
[cxx-interop] Emit IR for destructors of temporary C++ values
2022-10-21 18:23:52 +01:00
Egor Zhdan
93e7427ed2
[cxx-interop] Emit IR for destructors of temporary C++ values
...
This fixes the "undefined reference" linker errors.
rdar://101092732
2022-10-21 15:34:04 +01:00
Egor Zhdan
5a3bb14d83
[cxx-interop] Fix tests that passed -module-name Swift
...
`Swift` is the name of the Swift standard library module. Creating another module with this name breaks assumptions in the compiler and caused these two tests to fail.
2022-10-19 15:00:50 +01:00
zoecarver
001033763a
Fix tests.
2022-10-14 13:33:21 -07:00
Saleem Abdulrasool
5d832bf946
Merge pull request #61524 from compnerd/import
...
test: add `CxxShim` import for test
2022-10-11 08:10:19 -07:00
Saleem Abdulrasool
6519524e0a
Merge pull request #61500 from compnerd/mutable
...
ClangImporter: simplify logic for mutability attribute
2022-10-10 09:55:10 -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
642bffbe7d
Merge pull request #61512 from etcwilde/ewilde/unblock-windows-bot
...
Unblock mutability-annotations-typechecker failing test
2022-10-09 15:54:33 -07:00
Evan Wilde
af126e577f
Unblock mutability-annotations-typechecker failing test
...
Failing test info:
******************** TEST 'Swift(windows-x86_64) :: Interop/Cxx/class/mutability-annotations-typechecker.swift' FAILED ********************
Script:
--
: 'RUN: at line 1'; 't:\\swift\\bin\\swift-frontend.exe' -target x86_64-unknown-windows-msvc -module-cache-path T:\swift\swift-test-results\x86_64-unknown-windows-msvc\clang-module-cache -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -typo-correction-limit 10 -enable-source-import -sdk 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-PR-windows\\swift\\test\\Inputs\\clang-importer-sdk' -I 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-PR-windows\\swift\\test\\Inputs\\clang-importer-sdk\\swift-modules' -typecheck -I C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class\mutability-annotations-typechecker.swift -enable-experimental-cxx-interop -verify -verify-additional-file C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs/mutability-annotations.h
--
Exit Code: 1
Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "t:\\swift\\bin\\swift-frontend.exe" "-target" "x86_64-unknown-windows-msvc" "-module-cache-path" "T:\swift\swift-test-results\x86_64-unknown-windows-msvc\clang-module-cache" "-swift-version" "4" "-define-availability" "SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999" "-define-availability" "SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2" "-define-availability" "SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0" "-define-availability" "SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4" "-define-availability" "SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0" "-define-availability" "SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5" "-define-availability" "SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0" "-define-availability" "SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4" "-define-availability" "SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0" "-define-availability" "SwiftStdlib 5.8:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999" "-typo-correction-limit" "10" "-enable-source-import" "-sdk" "C:\\Users\\swift-ci\\jenkins\\workspace\\swift-PR-windows\\swift\\test\\Inputs\\clang-importer-sdk" "-I" "C:\\Users\\swift-ci\\jenkins\\workspace\\swift-PR-windows\\swift\\test\\Inputs\\clang-importer-sdk\\swift-modules" "-typecheck" "-I" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class\mutability-annotations-typechecker.swift" "-enable-experimental-cxx-interop" "-verify" "-verify-additional-file" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs/mutability-annotations.h"
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs/mutability-annotations.h:28:6: error: expected warning not produced
// expected-warning@+1 {{attribute 'nonmutating' is ignored when combined with attribute 'mutating'}}
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs/mutability-annotations.h:41:6: error: expected warning not produced
// expected-warning@+1 {{attribute 'nonmutating' has no effect without any mutable fields}}
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs/mutability-annotations.h:46:6: error: expected warning not produced
// expected-warning@+2 {{attribute 'nonmutating' has no effect without any mutable fields}}
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Interop\Cxx\class/Inputs/mutability-annotations.h:47:6: error: expected warning not produced
// expected-warning@+1 {{attribute 'nonmutating' has no effect on non-const method}}
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command failed with exit status: 1
--
********************
2022-10-09 11:34:08 -07:00
Saleem Abdulrasool
ad1bd8e685
Update mutability-annotations.h
2022-10-08 20:33:17 -07:00
Saleem Abdulrasool
7efe37f4c1
Update functions.swift
2022-10-08 19:44:01 -07:00
Butta
561f03a0fe
[android][test] Tweaks to get the new failing C++ Interop tests working
2022-09-25 13:51:17 +05:30
Zoe Carver
762e0baa50
Merge pull request #61217 from zoecarver/base-classes-as-fields
...
[cxx-interop] Add base classes as opaque fields when lowering in IRGen.
2022-09-21 09:22:12 -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
Evan Wilde
b0180c3804
Add generator requirements to cxx interop tests
...
The constructors-copy-irgen and constructors-irgen tests check code
generated by the X86 and ARM backends and will fail spectacularly if we
don't have the backend enabled. Adding the necessary codegenerator
requirements to those tests.
2022-09-17 18:22:43 -07:00
Nate Chandler
af6749e84c
[TypeLowering] Mark lexical when marking non-trivial.
...
In addition to starting all RecursiveProperties values which are
NonTrivial as Lexical, also mark instances of the structs which are
modified to become NonTrivial to simultaneously become Lexical.
2022-09-11 16:11:09 -07:00
Anthony Latsis
a65f1a161e
Gardening: Migrate test suite to GH issues: Interop
2022-08-31 05:20:25 +03:00
Nate Chandler
3c78a0bb90
[SILGen] Only lexical types get lexical lifetimes.
...
Only emit `begin_borrow [lexical]` and only mark `alloc_stack`s
`[lexical]` when the variable in question's lifetime is lexical, not
eager move.
2022-08-22 15:28:00 -07:00
Mishal Shah
91b2abe996
Merge pull request #60531 from apple/pull-request-rebranch
...
Merge `rebranch` into `main` to support llvm-project `stable/20220421`
2022-08-15 17:10:56 -07:00
zoecarver
39af79f491
[cxx-interop] Re-enable debug mangling.
2022-08-12 15:57:56 -07:00
swift-ci
41366ebccd
Merge remote-tracking branch 'origin/main' into rebranch
2022-08-12 03:54:16 -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
swift-ci
d81ba4efc7
Merge remote-tracking branch 'origin/main' into rebranch
2022-08-05 05:33:06 -07:00
Ehud Adler
f11e2afe07
[cxx-interop] Always import cxx shim when cxx-interop is enabled ( #60336 )
2022-08-05 08:28:47 -04:00
swift-ci
cbe82b6bfb
Merge remote-tracking branch 'origin/main' into rebranch
2022-08-02 06:14:04 -07:00
Ehud Adler
379fc1f0a4
[cxx-interop] Fix issue where multiple records in a module containing the same meth… ( #60338 )
2022-08-02 09:01:56 -04:00
swift-ci
30a3db1769
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-25 08:34:12 -07:00
Zoe Carver
b6574b5745
Merge pull request #60215 from zoecarver/diags-record-in-namesapce
...
[cxx-interop][diags] Fix diagnostics for records inside namespaces.
2022-07-25 08:14:37 -07:00
swift-ci
8029bda985
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-25 06:14:18 -07:00
Egor Zhdan
6fa2daf496
[cxx-interop] Do not crash when importing anonymous classes
...
This was discovered during interop adoption in SwiftCompilerSources.
```
/Volumes/Projects/swift/swift/include/swift/SIL/SILNode.h:180:5 <Spelling=/Volumes/Projects/swift/swift/include/swift/SIL/SILNode.h:171:3>: while adding SwiftName lookup table entries for clang declaration 'swift::SILNode::SharedUInt8Fields::(anonymous)'
```
2022-07-25 11:43:31 +01:00
zoecarver
d59d32f712
[cxx-interop][diags] Fix diagnostics for records inside namespaces.
2022-07-24 18:21:08 -07:00
swift-ci
9de631f94f
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-19 17:35:57 -07:00
zoecarver
79c68f8d53
[cxx-interop] Don't add incomplete records to lookup table.
2022-07-19 09:24:15 -04:00
zoecarver
3498ff9765
[cxx-interop] Remove UnsafeLifetimeOperation record semantic kind.
...
This makes "owned" the default kind for records that have custom copy constructors and no pointer-members.
2022-07-18 17:15:15 -04:00
zoecarver
9d1d03124b
[nfc][cxx-interop] Add diagnostics when something cannot be imported.
2022-07-18 17:15:15 -04:00
zoecarver
6acffbbee6
[cxx-interop] Flip the switch: only import safe APIs.
2022-07-18 17:15:15 -04:00
swift-ci
5c84024363
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-15 13:15:04 -07:00
Egor Zhdan
44c35a2971
[cxx-interop] Fix lookup of member operators
...
Calling `StructDecl::lookupDirect` with an operator identifier (e.g. `==`) previously returned no results. This happened because the underlying C++ operator function was added to the lookup table with an underscored name (e.g. `__operatorEqualEqual`), and the synthesized function was not added to the lookup table at all. Lookup should find the synthesized decl, since that is what Swift code will call.
This fixes a typechecker error when trying to conform a C++ struct that defines an operator to a Swift protocol with an operator requirement (e.g. `Equatable`).
2022-07-15 16:53:39 +01:00
swift-ci
d4005d615f
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-06 09:55:20 -07:00
Zoe Carver
524637288e
Merge pull request #59754 from zoecarver/fix-static-down-cast-shim
2022-07-06 09:36:22 -07:00
swift-ci
8b7ba703eb
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-05 20:14:02 -07: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
zoecarver
a353d6f272
[cxx-interop] Fix lazy member lookup for forward-declared structs inside of a namespace.
2022-07-05 11:54:02 -07:00
swift-ci
5c8f1fcb12
Merge remote-tracking branch 'origin/main' into rebranch
2022-07-02 17:03:37 -07:00
Egor Zhdan
0e31acb18c
[IRGen] Emit missing sret for function arguments
...
If the IR representation of a C++ function takes an `SRet` parameter instead of a return value, Swift needs to wrap the corresponding argument with `sret(...)` on call site.
This fixes SILOptimizer crashes on arm64.
rdar://92963081
2022-07-01 17:49:33 +01:00
swift-ci
2828990bfd
Merge remote-tracking branch 'origin/main' into rebranch
2022-06-27 12:53:23 -07:00