-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] convert CXXForeignReferenceTypeInitializers into SuppressCXXForeignReferenceTypeInitializers to be an opt-out flag #80659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2538,6 +2538,9 @@ llvm::SmallVector<clang::CXXMethodDecl *, 4> | |
SwiftDeclSynthesizer::synthesizeStaticFactoryForCXXForeignRef( | ||
const clang::CXXRecordDecl *cxxRecordDecl) { | ||
|
||
if (cxxRecordDecl->isAbstract()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have a test covering this branch? I am ok with the change but would be nice to have it actually tested. |
||
return {}; | ||
|
||
clang::ASTContext &clangCtx = cxxRecordDecl->getASTContext(); | ||
clang::Sema &clangSema = ImporterImpl.getClangSema(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// RUN: %target-swift-ide-test -print-module -module-to-print=POD -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s | ||
|
||
// CHECK: class Empty { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: I think it is not the right indentation. |
||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
// CHECK: class func create() -> Empty | ||
|
@@ -12,14 +12,14 @@ | |
// CHECK-NOT: func passThroughByValue(_ x: Empty) -> Empty | ||
|
||
// CHECK: class MultipleAttrs { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
// CHECK: class func create() -> MultipleAttrs | ||
// CHECK: } | ||
|
||
// CHECK: class IntPair { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
// CHECK: func instancePassThroughByRef(_ ref: IntPair) -> IntPair | ||
|
@@ -33,7 +33,7 @@ | |
// CHECK: func passThroughByRef(_ x: IntPair) -> IntPair | ||
|
||
// CHECK: class RefHoldingPair { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
// CHECK-NOT: pair | ||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
|
@@ -42,7 +42,7 @@ | |
// CHECK: } | ||
|
||
// CHECK: class RefHoldingPairRef { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
// CHECK: class func create() -> RefHoldingPairRef | ||
|
@@ -51,7 +51,7 @@ | |
// CHECK: } | ||
|
||
// CHECK: class RefHoldingPairPtr { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
// CHECK: class func create() -> RefHoldingPairPtr | ||
|
@@ -60,7 +60,6 @@ | |
// CHECK: } | ||
|
||
// CHECK: struct ValueHoldingPair { | ||
// CHECK-NOT: init | ||
// CHECK-NOT: pair | ||
// CHECK: init() | ||
// CHECK: func test() -> Int32 | ||
|
@@ -77,7 +76,7 @@ | |
// CHECK: } | ||
|
||
// CHECK: class BigType { | ||
// CHECK-NOT: init | ||
// CHECK: init | ||
// CHECK: func test() -> Int32 | ||
// CHECK: func testMutable() -> Int32 | ||
// CHECK: class func create() -> BigType | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,7 @@ struct NonCopyable { | |
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// CHECK: class MyImmortal { | ||
// CHECK-NEXT: init | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: indent the same as the function below. |
||
// CHECK-NEXT: func foo() | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: struct NonCopyable { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the only use of
isForeignReferenceTypeWithoutImmortalAttrs
. I think we could have fixed that function. Now I think it is unused so let's remove it.