add source to instruction
for debug
This commit is contained in:
@ -3,10 +3,17 @@ module Register
|
||||
|
||||
# a branch must branch to a block.
|
||||
class Branch < Instruction
|
||||
def initialize to
|
||||
def initialize source , to
|
||||
super(source)
|
||||
raise "No block" unless to
|
||||
@block = to
|
||||
end
|
||||
attr_reader :block
|
||||
attr_reader :block
|
||||
|
||||
def to_s
|
||||
"Branch(to: #{block.name})"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user