File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
SwiftCompilerSources/Sources/Optimizer/Utilities Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ extension Function {
3535 for inst in block. instructions {
3636
3737 inst. checkForwardingConformance ( )
38+ inst. checkGuaranteedResults ( )
3839
3940 if let verifiableInst = inst as? VerifiableInstruction {
4041 verifiableInst. verify ( context)
@@ -52,6 +53,13 @@ private extension Instruction {
5253 require ( !( self is ForwardingInstruction ) , " instruction \( self ) \n should not conform to ForwardingInstruction " )
5354 }
5455 }
56+
57+ func checkGuaranteedResults( ) {
58+ for result in results where result. ownership == . guaranteed {
59+ require ( BeginBorrowValue ( result) != nil || self is ForwardingInstruction ,
60+ " \( result) must either be a BeginBorrowValue or a ForwardingInstruction " )
61+ }
62+ }
5563}
5664
5765private extension Argument {
You can’t perform that action at this time.
0 commit comments