pass extra info into register init, not just value
extra info may be hash, maybe just type info
This commit is contained in:
@ -53,12 +53,13 @@ module Risc
|
||||
end
|
||||
|
||||
# require a (temporary) register. code must give this back with release_reg
|
||||
def use_reg( type , value = nil )
|
||||
# Second extra parameter may give extra info about the value, see RegisterValue
|
||||
def use_reg( type , extra = {} )
|
||||
raise "Not type #{type.inspect}" unless type.is_a?(Symbol) or type.is_a?(Parfait::Type)
|
||||
if @regs.empty?
|
||||
reg = Risc.tmp_reg(type , value)
|
||||
reg = Risc.tmp_reg(type , extra)
|
||||
else
|
||||
reg = @regs.last.next_reg_use(type , value)
|
||||
reg = @regs.last.next_reg_use(type , extra)
|
||||
end
|
||||
@regs << reg
|
||||
return reg
|
||||
|
Reference in New Issue
Block a user