mirror of
https://github.com/apple/swift.git
synced 2025-12-25 12:15:36 +01:00
This is how we originally controlled whether or not we printed out ownership annotations when we printed SIL. Since then, I have changed (a few months ago I believe) the ownership model eliminator to know how to eliminate these annotations from the SIL itself. So this hack can be removed. As an additional benefit, this will let me rename -enable-sil-ownership to -enable-sil-ownership-verifier. This will I hope eliminate confusion around this option in the short term while I am preparing to work on semantic sil again. rdar://42509812
18 lines
598 B
Plaintext
18 lines
598 B
Plaintext
// RUN: %empty-directory(%t)
|
|
// RUN: %build-irgen-test-overlays
|
|
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Swift
|
|
import Foundation
|
|
|
|
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc %swift.error* @errortype_from_nserror(%TSo7NSErrorC*)
|
|
// CHECK: %1 = bitcast %TSo7NSErrorC* %0 to %swift.error*
|
|
sil @errortype_from_nserror : $@convention(thin) (@owned NSError) -> @owned Error {
|
|
entry(%0 : @owned $NSError):
|
|
%1 = init_existential_ref %0 : $NSError : $NSError, $Error
|
|
return %1 : $Error
|
|
}
|
|
|