Skip to content

Commit 73e28df

Browse files
committed
ForwardingUtils logging
1 parent 00fbf4f commit 73e28df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/ForwardingUtils.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818

1919
import SIL
2020

21+
private let verbose = false
22+
23+
private func log(_ message: @autoclosure () -> String) {
24+
if verbose {
25+
print("### \(message())")
26+
}
27+
}
28+
2129
/// Return true if any use in `value`s forward-extend lifetime has
2230
/// .pointerEscape operand ownership.
2331
///
@@ -370,6 +378,7 @@ struct NonEscapingClosureDefUseWalker {
370378
if operand.instruction.isIncidentalUse {
371379
return .continueWalk
372380
}
381+
log(">>> Unexpected closure use \(operand)")
373382
// Escaping or unexpected closure use. Expected escaping uses include ReturnInst with a lifetime-dependent result.
374383
//
375384
// TODO: Check in the SIL verifier that all uses are expected.

0 commit comments

Comments
 (0)