mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This enables removal of those bridging calls for dead parameters. Read-only lets the optimizer remove such a call if the result is not used. Note that "readonly" means: no observable write operations. It's okay to allocate and initialize new objects. rdar://problem/44944094
19 lines
418 B
Swift
19 lines
418 B
Swift
// RUN: %target-swift-frontend -O -module-name=test -emit-sil %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
// Check if the optimizer can remove dead briding calls.
|
|
|
|
import Foundation
|
|
|
|
class Myclass : NSObject {
|
|
|
|
// CHECK-LABEL: sil hidden [thunk] @$s4test7MyclassC3fooyySSFTo
|
|
// CHECK-NEXT: bb0(%0 : $NSString, %1 : $Myclass):
|
|
// CHECK-NEXT: tuple ()
|
|
// CHECK-NEXT: return
|
|
@objc func foo(_ s: String) {
|
|
}
|
|
}
|
|
|