mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Previously, `isScopeAffectingInstructionDead` determined that an otherwise satisfactory `load` was not dead if it was a `load [take]`. The immediate effect was that dead `load [take]`s were not deleted. The downstream effect was that otherwise dead graphs of instructions would not be deleted. This was especially a problem for OSLogOptimization which deletes a great deal of code. Here, the InstructionDeleter is taught to compensate for the deletion of such `load [take]` by inserting `destroy_addr`s in their stead. rdar://117011668
21 lines
561 B
Swift
21 lines
561 B
Swift
// RUN: %target-swift-frontend -disable-availability-checking -emit-sil -verify %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
import os.log
|
|
|
|
struct Log {
|
|
static let attachmentLedgerTopic = Logger(
|
|
subsystem: "com.xxx.yyy.zzz",
|
|
category: "ccc")
|
|
}
|
|
|
|
// CHECK-LABEL: sil @logWriter : {{.*}} {
|
|
// CHECK-NOT: $s2os18OSLogInterpolationV13appendLiteralyySSF
|
|
// CHECK-LABEL: } // end sil function 'logWriter'
|
|
@_silgen_name("logWriter")
|
|
public func logWriter(_ attachmentID: UUID) {
|
|
Log.attachmentLedgerTopic.info("aaa: \(attachmentID)")
|
|
}
|