Skip to main content

DataFlowGraphBuilder

Struct DataFlowGraphBuilder 

Source
pub struct DataFlowGraphBuilder { /* private fields */ }

Implementations§

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn current_scope(&mut self) -> *mut DfgScope

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn empty( def_arena: *mut DefArena, key_arena: *mut RefinementKeyArena, ) -> DataFlowGraph

Source§

impl DataFlowGraphBuilder

Source

pub fn join(&mut self, p: *mut DfgScope, a: *mut DfgScope, b: *mut DfgScope)

Source§

impl DataFlowGraphBuilder

Source

pub fn join_bindings(&mut self, p: *mut DfgScope, a: &DfgScope, b: &DfgScope)

void DataFlowGraphBuilder::joinBindings(...).

Same borrow-safety concern as join_props: the while-loop visitor calls join(scope, scope, whileScope), so p aliases a. Iterating a.bindings while get_or_insert mutates p.bindings (the same map) is &/&mut aliasing UB. Snapshot a/b bindings into owned vectors first so no borrow of a scope’s bindings is held across the mutation of p.bindings.

Source§

impl DataFlowGraphBuilder

Source

pub fn join_props(&mut self, result: *mut DfgScope, a: &DfgScope, b: &DfgScope)

void DataFlowGraphBuilder::joinProps(DfgScope* result, const DfgScope& a, const DfgScope& b). Reference: DataFlowGraph.cpp:246-294.

Borrow-safety note: the while-loop visitor calls join(scope, scope, whileScope), so result and a are the same DfgScope. The faithful C++ mutates result->props while iterating a->props (and reads scope->props inside joinProps’ lambda while holding a reference into it) — in Rust that is &/&mut aliasing UB: even without a rehash the optimizer assumes the &mut is unique and miscompiles, corrupting the props map’s Vec header (observed as a later find indexing an empty data). We therefore snapshot a’s and b’s props into owned values first, and have phinodify build each merged entry in a local BTreeMap before writing it back — exactly the pattern DfgScope::inherit uses. The observable result is identical to the C++ (lookup_def_id_string is only consulted when the in-progress entry has no value for the key, so a deferred write-back cannot change its answer).

Source§

impl DataFlowGraphBuilder

Source

pub fn lookup_symbol_location( &mut self, symbol: Symbol, location: Location, ) -> DefId

Source§

impl DataFlowGraphBuilder

Source

pub fn lookup_def_id_string_location( &mut self, def: DefId, key: &String, location: Location, ) -> DefId

DefId DataFlowGraphBuilder::lookup(DefId def, const std::string& key, Location location). Reference: DataFlowGraph.cpp:328-364.

Source§

impl DataFlowGraphBuilder

Source

pub fn make_child_scope(&mut self, scope_type: ScopeType) -> *mut DfgScope

Source§

impl DataFlowGraphBuilder

Source

pub fn operator_assign( &mut self, _other: &DataFlowGraphBuilder, ) -> &mut DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn resolve_captures(&mut self)

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn visit_function( &mut self, f: *mut AstExprFunction, signature_scope: *mut DfgScope, ) -> DataFlowResult

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn visit_l_value_ast_expr_def_id( &mut self, e: *mut AstExpr, incoming_def: DefId, )

Source§

impl DataFlowGraphBuilder

Source

pub fn visit_l_value_ast_expr_local_def_id( &mut self, l: *mut AstExprLocal, incoming_def: DefId, ) -> DefId

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn visit_l_value_ast_expr_error_def_id( &mut self, error: *mut AstExprError, _incoming_def: DefId, ) -> DefId

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source

pub fn visit_type_list(&mut self, l: AstTypeList)

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Source§

impl DataFlowGraphBuilder

Trait Implementations§

Source§

impl Debug for DataFlowGraphBuilder

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 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, 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.