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 {
35
35
for inst in block. instructions {
36
36
37
37
inst. checkForwardingConformance ( )
38
+ inst. checkGuaranteedResults ( )
38
39
39
40
if let verifiableInst = inst as? VerifiableInstruction {
40
41
verifiableInst. verify ( context)
@@ -52,6 +53,13 @@ private extension Instruction {
52
53
require ( !( self is ForwardingInstruction ) , " instruction \( self ) \n should not conform to ForwardingInstruction " )
53
54
}
54
55
}
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
+ }
55
63
}
56
64
57
65
private extension Argument {
You can’t perform that action at this time.
0 commit comments