pub struct FunctionData {
Show 13 fields pub variant: FunctionVariant, pub type_args: Vec<Type>, pub code: Vec<Bytecode>, pub local_types: Vec<Type>, pub return_types: Vec<Type>, pub acquires_global_resources: Vec<StructId>, pub locations: BTreeMap<AttrId, Loc>, pub loop_invariants: BTreeSet<AttrId>, pub debug_comments: BTreeMap<AttrId, String>, pub vc_infos: BTreeMap<AttrId, String>, pub annotations: Annotations, pub name_to_index: BTreeMap<Symbol, usize>, pub modify_targets: BTreeMap<QualifiedId<StructId>, Vec<Exp>>,
}
Expand description

Holds the owned data belonging to a FunctionTarget, contained in a FunctionTargetsHolder.

Fields§

§variant: FunctionVariant

The function variant.

§type_args: Vec<Type>

The type instantiation.

§code: Vec<Bytecode>

The bytecode.

§local_types: Vec<Type>

The locals, including parameters.

§return_types: Vec<Type>

The return types.

§acquires_global_resources: Vec<StructId>

The set of global resources acquired by this function.

§locations: BTreeMap<AttrId, Loc>

A map from byte code attribute to source code location.

§loop_invariants: BTreeSet<AttrId>

The set of asserts that represent loop invariants

§debug_comments: BTreeMap<AttrId, String>

A map from byte code attribute to comments associated with this bytecode. These comments are generated by transformations and are intended for internal debugging when the bytecode is dumped.

§vc_infos: BTreeMap<AttrId, String>

A map from byte code attribute to a message to be printed out if verification fails at this bytecode.

§annotations: Annotations

Annotations associated with this function. This is shared between multiple function variants.

§name_to_index: BTreeMap<Symbol, usize>

A mapping from symbolic names to temporaries.

§modify_targets: BTreeMap<QualifiedId<StructId>, Vec<Exp>>

A cache of targets modified by this function.

Implementations§

source§

impl FunctionData

source

pub fn new( func_env: &FunctionEnv<'_>, code: Vec<Bytecode>, local_types: Vec<Type>, return_types: Vec<Type>, locations: BTreeMap<AttrId, Loc>, acquires_global_resources: Vec<StructId>, loop_invariants: BTreeSet<AttrId> ) -> Self

Creates new function target data.

source

pub fn next_free_attr_index(&self) -> usize

Computes the next available index for AttrId.

source

pub fn next_free_label_index(&self) -> usize

Computes the next available index for Label.

source

pub fn rename_vars<F>(&mut self, _f: &F)where F: Fn(TempIndex) -> TempIndex,

Apply a variable renaming to this data, adjusting internal data structures.

source

pub fn fork(&self, new_variant: FunctionVariant) -> Self

Fork this function data, without annotations, and mark it as the given variant.

source

pub fn fork_with_instantiation( &self, env: &GlobalEnv, inst: &[Type], new_variant: FunctionVariant ) -> Self

Fork this function data with (potentially partial) instantiations.

source

pub fn get_type_instantiation(&self, _fun_env: &FunctionEnv<'_>) -> Vec<Type>

Get the instantiation of this function as a vector of types.

Trait Implementations§

source§

impl Clone for FunctionData

source§

fn clone(&self) -> FunctionData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FunctionData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V