pub struct DataFlowGraphBuilder { /* private fields */ }Implementations§
Source§impl DataFlowGraphBuilder
impl DataFlowGraphBuilder
pub fn build( block: *mut AstStatBlock, def_arena: *mut DefArena, key_arena: *mut RefinementKeyArena, handle: *mut InternalErrorReporter, ) -> DataFlowGraph
Source§impl DataFlowGraphBuilder
impl DataFlowGraphBuilder
pub fn current_scope(&mut self) -> *mut DfgScope
Source§impl DataFlowGraphBuilder
impl DataFlowGraphBuilder
Sourcepub fn data_flow_graph_builder_data_flow_graph_builder(&self)
pub fn data_flow_graph_builder_data_flow_graph_builder(&self)
@delete
Source§impl DataFlowGraphBuilder
impl DataFlowGraphBuilder
pub fn data_flow_graph_builder_not_null_def_arena_not_null_refinement_key_arena( def_arena: *mut DefArena, key_arena: *mut RefinementKeyArena, ) -> Self
Source§impl DataFlowGraphBuilder
impl DataFlowGraphBuilder
pub fn empty( def_arena: *mut DefArena, key_arena: *mut RefinementKeyArena, ) -> DataFlowGraph
Source§impl DataFlowGraphBuilder
impl DataFlowGraphBuilder
Sourcepub fn join_bindings(&mut self, p: *mut DfgScope, a: &DfgScope, b: &DfgScope)
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
impl DataFlowGraphBuilder
Sourcepub fn join_props(&mut self, result: *mut DfgScope, a: &DfgScope, b: &DfgScope)
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).