Move booting to RubyXCompiler init
Also pass the source into the compile method. This way compiler can be reused for subsequent compile. Does remove some double boots, but no major time save
This commit is contained in:
@ -8,8 +8,6 @@ module Elf
|
||||
DEBUG = false
|
||||
|
||||
def setup
|
||||
Parfait.boot!
|
||||
Risc.boot!
|
||||
end
|
||||
|
||||
def in_space(input)
|
||||
@ -19,7 +17,7 @@ module Elf
|
||||
in_space("def main(arg);#{input};end")
|
||||
end
|
||||
def check(input, file)
|
||||
linker = RubyX::RubyXCompiler.new(input).ruby_to_binary( :arm )
|
||||
linker = RubyX::RubyXCompiler.new.ruby_to_binary( input , :arm )
|
||||
writer = Elf::ObjectWriter.new(linker)
|
||||
writer.save "test/#{file}.o"
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ module Elf
|
||||
|
||||
def setup
|
||||
super
|
||||
@linker = RubyX::RubyXCompiler.new(as_main("return 1")).ruby_to_risc(:arm)
|
||||
@linker = RubyX::RubyXCompiler.new.ruby_to_risc(as_main("return 1"),:arm)
|
||||
@linker.position_all
|
||||
@linker.create_binary
|
||||
end
|
||||
|
Reference in New Issue
Block a user