pub struct Symtab<'ir> { /* private fields */ }
Expand description
A Symtab is a symbol table that maps each u32
identifier used
in the IR to it’s &str
name and vice-versa.
Implementations§
Source§impl<'ir> Symtab<'ir>
impl<'ir> Symtab<'ir>
pub fn intern(&mut self, sym: &'ir str) -> Name
pub fn gensym(&mut self) -> Name
pub fn to_raw_table(&self) -> Vec<String>
pub fn from_raw_table(raw: &'ir [String]) -> Self
pub fn to_str(&self, n: Name) -> &'ir str
pub fn new() -> Self
pub fn lookup(&self, sym: &str) -> Name
pub fn get(&self, sym: &str) -> Option<Name>
pub fn intern_ty(&mut self, ty: &'ir Ty<String>) -> Ty<Name>
pub fn get_loc(&self, loc: &Loc<String>) -> Option<Loc<Name>>
pub fn intern_loc(&mut self, loc: &'ir Loc<String>) -> Loc<Name>
pub fn intern_exp(&mut self, exp: &'ir Exp<String>) -> Exp<Name>
pub fn intern_instr<B: BV>( &mut self, instr: &'ir Instr<String, B>, ) -> Instr<Name, B>
pub fn intern_def<B: BV>(&mut self, def: &'ir Def<String, B>) -> Def<Name, B>
pub fn intern_defs<B: BV>( &mut self, defs: &'ir [Def<String, B>], ) -> Vec<Def<Name, B>>
Trait Implementations§
Auto Trait Implementations§
impl<'ir> Freeze for Symtab<'ir>
impl<'ir> RefUnwindSafe for Symtab<'ir>
impl<'ir> Send for Symtab<'ir>
impl<'ir> Sync for Symtab<'ir>
impl<'ir> Unpin for Symtab<'ir>
impl<'ir> UnwindSafe for Symtab<'ir>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more