Define a return instruction.
It is possible to return multiple values from a function, so ReturnData contains a VariableArgs instance. We don't want return instructions to appear as 'return (v1)', so tweak the printing of VariableArgs so the parantheses are added externally.
This commit is contained in:
@@ -95,6 +95,18 @@ trapnz = Instruction(
|
||||
""",
|
||||
ins=c)
|
||||
|
||||
rvals = Operand('rvals', variable_args, doc='return values')
|
||||
|
||||
x_return = Instruction(
|
||||
'return', r"""
|
||||
Return from the function.
|
||||
|
||||
Unconditionally transfer control to the calling function, passing the
|
||||
provided return values. The list of return values must match the
|
||||
function signature's return types.
|
||||
""",
|
||||
ins=rvals)
|
||||
|
||||
#
|
||||
# Materializing constants.
|
||||
#
|
||||
|
||||
@@ -43,6 +43,8 @@ BranchTable = InstructionFormat(value, jump_table)
|
||||
|
||||
Call = InstructionFormat(
|
||||
function, variable_args, multiple_results=True, boxed_storage=True)
|
||||
Return = InstructionFormat(variable_args, boxed_storage=True)
|
||||
|
||||
|
||||
# Finally extract the names of global variables in this module.
|
||||
InstructionFormat.extract_names(globals())
|
||||
|
||||
Reference in New Issue
Block a user