pub struct FunctionData {Show 14 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>>,
pub ghost_type_param_count: usize,
}Expand description
Holds the owned data belonging to a FunctionTarget, contained in a
FunctionTargetsHolder.
Fields
variant: FunctionVariantThe 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: AnnotationsAnnotations 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.
ghost_type_param_count: usizeThe number of ghost type parameters introduced in order to instantiate related invariants
Implementations
sourceimpl FunctionData
impl FunctionData
sourcepub 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
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.
sourcepub fn next_free_attr_index(&self) -> usize
pub fn next_free_attr_index(&self) -> usize
Computes the next available index for AttrId.
sourcepub fn next_free_label_index(&self) -> usize
pub fn next_free_label_index(&self) -> usize
Computes the next available index for Label.
sourcepub fn rename_vars<F>(&mut self, _f: &F) where
F: Fn(TempIndex) -> TempIndex,
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.
sourcepub fn fork(&self, new_variant: FunctionVariant) -> Self
pub fn fork(&self, new_variant: FunctionVariant) -> Self
Fork this function data, without annotations, and mark it as the given variant.
sourcepub fn fork_with_instantiation(
&self,
env: &GlobalEnv,
inst: &[Type],
new_variant: FunctionVariant
) -> Self
pub fn fork_with_instantiation(
&self,
env: &GlobalEnv,
inst: &[Type],
new_variant: FunctionVariant
) -> Self
Fork this function data with (potentially partial) instantiations.
Trait Implementations
sourceimpl Clone for FunctionData
impl Clone for FunctionData
sourcefn clone(&self) -> FunctionData
fn clone(&self) -> FunctionData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for FunctionData
impl !Send for FunctionData
impl !Sync for FunctionData
impl Unpin for FunctionData
impl !UnwindSafe for FunctionData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more