stuff
This commit is contained in:
@@ -2,12 +2,14 @@ use std::collections::HashMap;
|
||||
|
||||
use super::{AddrID, IRLData, IRLFunction, IRLInstruction, IRUInstruction, Namespace, VarID};
|
||||
|
||||
pub struct Program {
|
||||
pub struct IRLProgram {
|
||||
pub fns: Vec<IRLFunction>,
|
||||
pub data: Vec<IRLData>,
|
||||
}
|
||||
|
||||
impl Program {
|
||||
// NOTE: there are THREE places here where I specify size (8)
|
||||
|
||||
impl IRLProgram {
|
||||
pub fn create(ns: &Namespace) -> Self {
|
||||
let mut fns = Vec::new();
|
||||
let mut data = Vec::new();
|
||||
|
||||
@@ -53,8 +53,8 @@ impl Namespace {
|
||||
pub fn get_fn(&self, id: FnID) -> &FnDef {
|
||||
&self.fn_defs[id.0]
|
||||
}
|
||||
pub fn get_fn_var(&self, id: VarID) -> &FnDef {
|
||||
&self.fn_defs[self.fn_map[&id].0]
|
||||
pub fn get_fn_var(&self, id: VarID) -> Option<&FnDef> {
|
||||
Some(&self.fn_defs[self.fn_map.get(&id)?.0])
|
||||
}
|
||||
pub fn get_type(&self, id: TypeID) -> &TypeDef {
|
||||
&self.type_defs[id.0]
|
||||
@@ -102,7 +102,6 @@ impl Namespace {
|
||||
self.fn_defs.push(def);
|
||||
self.fns.push(None);
|
||||
|
||||
|
||||
id
|
||||
}
|
||||
pub fn def_type(&mut self, def: TypeDef) -> TypeID {
|
||||
@@ -230,4 +229,3 @@ impl Idents {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user