This commit is contained in:
2024-12-06 20:04:04 -05:00
parent 620c4557e9
commit e63f652eb5
6 changed files with 27 additions and 20 deletions

View File

@@ -4,13 +4,13 @@ use crate::{
compiler::{arch::riscv64::Reg, create_program, Addr},
ir::{
arch::riscv64::{RV64Instruction as AI, RegRef},
IRLInstruction as IRI, Program,
IRLInstruction as IRI, IRLProgram,
},
};
use super::{LinkerInstruction as LI, *};
pub fn compile(program: Program) -> (Vec<u8>, Option<Addr>) {
pub fn compile(program: IRLProgram) -> (Vec<u8>, Option<Addr>) {
let mut fns = Vec::new();
let mut data = Vec::new();
for d in program.data {

View File

@@ -12,9 +12,9 @@ mod target;
pub use program::*;
use crate::ir::Program;
use crate::ir::IRLProgram;
pub fn compile(program: Program) -> Vec<u8> {
pub fn compile(program: IRLProgram) -> Vec<u8> {
let (compiled, start) = arch::riscv64::compile(program);
let binary = elf::create(compiled, start.expect("no start method found"));
binary