propagate constants from block_compiler up
up to method_compiler, where they are collected by mom_compiler (and included in binary)
This commit is contained in:
@ -10,6 +10,11 @@ module Risc
|
||||
super(method)
|
||||
end
|
||||
|
||||
#include block_compilers constants
|
||||
def constants
|
||||
block_compilers.inject(@constants.dup){|all, compiler| all += compiler.constants}
|
||||
end
|
||||
|
||||
def source_name
|
||||
"#{@callable.self_type.name}.#{@callable.name}"
|
||||
end
|
||||
@ -106,12 +111,6 @@ module Risc
|
||||
end
|
||||
end
|
||||
|
||||
# add a constant (which get created during compilation and need to be linked)
|
||||
def add_constant(const)
|
||||
raise "Must be Parfait #{const}" unless const.is_a?(Parfait::Object)
|
||||
@constants << const
|
||||
end
|
||||
|
||||
# add a risc instruction after the current (insertion point)
|
||||
# the added instruction will become the new insertion point
|
||||
def add_code( instruction )
|
||||
|
Reference in New Issue
Block a user