mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Mandatory copy propagation was primarily a stop-gap until lexcial lifetimes were implemented. It supposedly made variables lifetimes more consistent between -O and -Onone builds. Now that lexical lifetimes are enabled, it is no longer needed for that purpose (and will never satisfactorily meet that goal anyway). Mandatory copy propagation may be enabled again later as a -Onone " optimization. But that requires a more careful audit of the effect on debug information. For now, it should be disabled.
41 lines
1.1 KiB
Swift
41 lines
1.1 KiB
Swift
// RUN: %target-swift-frontend %s -emit-sil -emit-verbose-sil -g -o - | %FileCheck %s --check-prefixes=CHECK
|
|
|
|
class NSURL {}
|
|
|
|
class NSPathControlItem {
|
|
var URL: NSURL?
|
|
}
|
|
|
|
class NSPathControl {
|
|
var clickedPathItem: NSPathControlItem?;
|
|
}
|
|
|
|
class AppDelegate {
|
|
|
|
func LogStr(_ message: String) {
|
|
}
|
|
|
|
func componentClicked(_ sender: AnyObject)
|
|
{
|
|
if let control = sender as? NSPathControl
|
|
{
|
|
LogStr( "Got a path control" )
|
|
if let item = control.clickedPathItem
|
|
{
|
|
LogStr( "Got an NSPathControlItem" )
|
|
// Verify that the branch's location is >= the cleanup's location.
|
|
// (The implicit false block of the conditional
|
|
// below inherits the location from the condition.)
|
|
// CHECK: br{{.*}}line:[[@LINE+1]]
|
|
if let url = item.URL
|
|
{
|
|
LogStr( "There is a url" )
|
|
}
|
|
// Verify that the branch's location is >= the cleanup's location.
|
|
// CHECK-NCP: strong_release{{.*}}$NSPathControlItem{{.*}}line:[[@LINE+2]]
|
|
// CHECK: br{{.*}}line:[[@LINE+1]]
|
|
}
|
|
}
|
|
}
|
|
}
|