SharedState

Struct SharedState 

Source
pub struct SharedState<'ir, B> {
    pub functions: HashMap<Name, (Vec<(Name, &'ir Ty<Name>)>, Ty<Name>, &'ir [Instr<Name, B>])>,
    pub symtab: Symtab<'ir>,
    pub structs: HashMap<Name, HashMap<Name, Ty<Name>>>,
    pub enums: HashMap<Name, HashSet<Name>>,
    pub enum_members: HashMap<Name, (usize, usize)>,
    pub union_ctors: HashSet<Name>,
    pub probes: HashSet<Name>,
    pub reset_registers: HashMap<Loc<Name>, Reset<B>>,
}
Expand description

All symbolic evaluation happens over some (immutable) IR. The SharedState provides each worker that is performing symbolic evaluation with a convenient view into that IR.

Fields§

§functions: HashMap<Name, (Vec<(Name, &'ir Ty<Name>)>, Ty<Name>, &'ir [Instr<Name, B>])>

A map from function identifers to function bodies and parameter lists

§symtab: Symtab<'ir>

The symbol table for the IR

§structs: HashMap<Name, HashMap<Name, Ty<Name>>>

A map from struct identifers to a map from field identifiers to their types

§enums: HashMap<Name, HashSet<Name>>

A map from enum identifiers to sets of their member identifiers

§enum_members: HashMap<Name, (usize, usize)>

enum_members maps each enum member for every enum to it’s position (as a (pos, size) pair, i.e. 1 of 3) within its respective enum

§union_ctors: HashSet<Name>

union_ctors is a set of all union constructor identifiers

§probes: HashSet<Name>

probes is a set of function/location identifers to trace

§reset_registers: HashMap<Loc<Name>, Reset<B>>

reset_registers is a are reset values for each register derived from the ISA config

Implementations§

Source§

impl<'ir, B: BV> SharedState<'ir, B>

Source

pub fn new( symtab: Symtab<'ir>, defs: &'ir [Def<Name, B>], probes: HashSet<Name>, reset_registers: HashMap<Loc<Name>, Reset<B>>, ) -> Self

Source

pub fn enum_member_from_str(&self, member: &str) -> Option<usize>

Source

pub fn enum_member(&self, member: Name) -> Option<usize>

Auto Trait Implementations§

§

impl<'ir, B> Freeze for SharedState<'ir, B>

§

impl<'ir, B> !RefUnwindSafe for SharedState<'ir, B>

§

impl<'ir, B> Send for SharedState<'ir, B>

§

impl<'ir, B> Sync for SharedState<'ir, B>

§

impl<'ir, B> Unpin for SharedState<'ir, B>

§

impl<'ir, B> !UnwindSafe for SharedState<'ir, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.