add function_return helper to risc_value

create a function_return from within builder
This commit is contained in:
Torsten Ruger
2018-08-06 13:03:33 +03:00
parent c9d8f750e5
commit 595e032edf
3 changed files with 14 additions and 1 deletions

View File

@ -134,6 +134,14 @@ module Risc
op
end
# generate a Function return instruction
# using the register as the parameter where the return address is passed
def function_return
ret = Risc::FunctionReturn.new("return", self)
builder.add_code(ret) if builder
ret
end
# just capture the values in an intermediary object (RValue)
# The RValue then gets used in a RegToSlot ot SlotToReg, where
# the values are unpacked to call Risc.reg_to_slot or Risc.slot_to_reg