add register names to allocator

make platform instantiate it
basic plumbing
This commit is contained in:
2020-03-18 15:27:40 +02:00
parent 500df01425
commit 8df1b8126f
5 changed files with 32 additions and 16 deletions

View File

@ -8,14 +8,26 @@ module Risc
# return the translator instance that traslates risc intructions into
# platform specific ones
def translator
raise "not implemented"
end
# return an integer where the binary is loaded
def loaded_at
raise "not implemented"
end
# return the number of registers the platform supports
def num_registers
raise "not implemented"
end
# return the Allocator for the platform
# stanrard implementation return StandardAllocator, which uses
# num_registers and assumes rXX naming (ie arm + interpreter)
#
# Possibility to override and implemented different schemes
def allocator(compiler)
StandardAllocator.new(compiler , self )
end
# Factory method to create a Platform object according to the platform