diff options
Diffstat (limited to 'source/blender/functions/intern/multi_function_procedure_builder.cc')
-rw-r--r-- | source/blender/functions/intern/multi_function_procedure_builder.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/functions/intern/multi_function_procedure_builder.cc b/source/blender/functions/intern/multi_function_procedure_builder.cc index 1e686bbd94d..1036bb5f720 100644 --- a/source/blender/functions/intern/multi_function_procedure_builder.cc +++ b/source/blender/functions/intern/multi_function_procedure_builder.cc @@ -53,6 +53,11 @@ void MFInstructionCursor::insert(MFProcedure &procedure, MFInstruction *new_inst static_cast<MFDummyInstruction *>(instruction_)->set_next(new_instruction); break; } + case MFInstructionType::Return: { + /* It shouldn't be possible to build a cursor that points to a return instruction. */ + BLI_assert_unreachable(); + break; + } } } } @@ -72,6 +77,14 @@ void MFProcedureBuilder::add_destruct(Span<MFVariable *> variables) } } +MFReturnInstruction &MFProcedureBuilder::add_return() +{ + MFReturnInstruction &instruction = procedure_->new_return_instruction(); + this->link_to_cursors(&instruction); + cursors_ = {}; + return instruction; +} + MFCallInstruction &MFProcedureBuilder::add_call_with_no_variables(const MultiFunction &fn) { MFCallInstruction &instruction = procedure_->new_call_instruction(fn); |