File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4361,6 +4361,8 @@ The following types of test arguments are supported:
4361
4361
Example: @function[foo].block[2]
4362
4362
- trace: @trace <-- the first ``debug_value [trace] `` in the current function
4363
4363
@trace[uint] <-- the ``debug_value [trace] `` at index ``uint ``
4364
+ - value: @{instruction}.result <-- the first result of the instruction
4365
+ @{instruction}.result[uint] <-- the result at index ``uint `` produced by the instruction
4364
4366
@{function}.{trace} <-- the indicated trace in the indicated function
4365
4367
Example: @function[bar].trace
4366
4368
- argument: @argument <-_ the first argument of the current block
Original file line number Diff line number Diff line change @@ -343,6 +343,28 @@ class ParseArgumentSpecification {
343
343
return OperandArgument{operand};
344
344
}
345
345
346
+ SILValue parseResultComponent (SILInstruction *within) {
347
+ if (!consumePrefix (" result" ))
348
+ return nullptr ;
349
+ if (empty ()) {
350
+ auto result = within->getResult (0 );
351
+ return result;
352
+ }
353
+ if (auto subscript = parseSubscript ()) {
354
+ auto index = subscript->get <unsigned long long >();
355
+ auto result = within->getResult (index);
356
+ return result;
357
+ }
358
+ llvm_unreachable (" bad suffix after 'result'!?" );
359
+ }
360
+
361
+ llvm::Optional<Argument> parseResultReference (SILInstruction *within) {
362
+ auto result = parseResultComponent (within);
363
+ if (!result)
364
+ return llvm::None;
365
+ return ValueArgument{result};
366
+ }
367
+
346
368
SILArgument *parseBlockArgumentComponent (SILBasicBlock *block) {
347
369
if (!consumePrefix (" argument" ))
348
370
return nullptr ;
@@ -414,6 +436,8 @@ class ParseArgumentSpecification {
414
436
return InstructionArgument{instruction};
415
437
if (auto arg = parseOperandReference (instruction))
416
438
return arg;
439
+ if (auto res = parseResultReference (instruction))
440
+ return res;
417
441
llvm_unreachable (" unhandled suffix after 'instruction'!?" );
418
442
}
419
443
You can’t perform that action at this time.
0 commit comments