mirror of
https://github.com/apple/swift.git
synced 2026-10-26 20:15:53 +01:00
The swift/bridging header provides annotation macros (e.g., SWIFT_SHARED_REFERENCE, SWIFT_COMPUTED_PROPERTY) for C++ code that interoperate with Swift. Previously, this header was shipped in the Swift toolchain's usr/include, which is not part of Clang's default search paths in the OSS toolchain, which forced users to manually pass -I flags to find the header. By placing it in Clang's resource directory, the header is automatically discoverable by both clang and swift (via its embedded Clang instance), since both already search <clang-resource-dir>/include by default. In addition to removing lib/ClangImporter/SwiftBridging/, where the swift/bridging lived, this patch also removes build settings related to the bridging header (SWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER and the --enable-cxx-interop-swift-bridging-header build-script flag), as well as the explicit -I flags in interop tests pointing to the old SwiftBridging directory. rdar://136716355
58 lines
2.0 KiB
Swift
58 lines
2.0 KiB
Swift
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=upcoming-swift -module-to-print=RefCountingMethods -I %S/Inputs -source-filename=x | %FileCheck --check-prefixes=CHECK,CHECK-OFF %s
|
|
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=upcoming-swift -enable-experimental-feature ForeignReferenceTypeInheritance -module-to-print=RefCountingMethods -I %S/Inputs -source-filename=x | %FileCheck --check-prefixes=CHECK,CHECK-ON %s
|
|
|
|
// REQUIRES: swift_feature_ForeignReferenceTypeInheritance
|
|
|
|
// CHECK: class RefCountedBox {
|
|
// CHECK: func doRetain()
|
|
// CHECK: func doRelease()
|
|
// CHECK: }
|
|
// CHECK-OFF: class DerivedRefCountedBox {
|
|
// CHECK-OFF: func doRetain()
|
|
// CHECK-OFF: func doRelease()
|
|
// CHECK-OFF: }
|
|
// CHECK-ON: class DerivedRefCountedBox : RefCountedBox {
|
|
// CHECK-ON: }
|
|
|
|
// CHECK: class DerivedHasRelease {
|
|
// CHECK: func doRetainInBase()
|
|
// CHECK: func doRelease()
|
|
// CHECK: }
|
|
|
|
// CHECK: class TemplatedDerivedHasRelease<CFloat> {
|
|
// CHECK: var value: Float
|
|
// CHECK: func doReleaseTemplated()
|
|
// CHECK: func doRetainInBase()
|
|
// CHECK: }
|
|
// CHECK: class TemplatedDerivedHasRelease<CInt> {
|
|
// CHECK: var value: Int32
|
|
// CHECK: func doReleaseTemplated()
|
|
// CHECK: func doRetainInBase()
|
|
// CHECK: }
|
|
|
|
// CHECK-OFF: class CRTPDerived {
|
|
// CHECK-ON: class CRTPDerived : CRTPBase<CRTPDerived> {
|
|
// CHECK: var value: Int32
|
|
// CHECK: }
|
|
|
|
// CHECK: class VirtualRetainRelease {
|
|
// CHECK: func doRetainVirtual()
|
|
// CHECK: func doReleaseVirtual()
|
|
// CHECK: }
|
|
// CHECK-OFF: class DerivedVirtualRetainRelease {
|
|
// CHECK-ON: class DerivedVirtualRetainRelease : VirtualRetainRelease {
|
|
// CHECK: func doRetainVirtual()
|
|
// CHECK: func doReleaseVirtual()
|
|
// CHECK: }
|
|
|
|
// CHECK: class PureVirtualRetainRelease {
|
|
// CHECK: func doRetainPure()
|
|
// CHECK: func doReleasePure()
|
|
// CHECK: }
|
|
// CHECK-OFF: class DerivedPureVirtualRetainRelease {
|
|
// CHECK-ON: class DerivedPureVirtualRetainRelease : PureVirtualRetainRelease {
|
|
// CHECK: func doRetainPure()
|
|
// CHECK: func doReleasePure()
|
|
// CHECK: var refCount: Int32
|
|
// CHECK: }
|