pub struct CfgBuilder {
pub cfg: Option<ControlFlowGraph>,
pub allocator: *mut CfgAllocator,
pub current_block: *mut Block,
pub sealed_blocks: DenseHashSet<*mut Block>,
pub incomplete_joins: DenseHashMap<*mut Block, BTreeSet<*mut Join>>,
pub version_counter: DenseHashMap<Symbol, usize>,
}Fields§
§cfg: Option<ControlFlowGraph>§allocator: *mut CfgAllocator§current_block: *mut Block§sealed_blocks: DenseHashSet<*mut Block>§incomplete_joins: DenseHashMap<*mut Block, BTreeSet<*mut Join>>§version_counter: DenseHashMap<Symbol, usize>Implementations§
Source§impl CfgBuilder
impl CfgBuilder
Sourcepub fn block_scope_cfg_builder_block(&mut self, target: *mut Block)
pub fn block_scope_cfg_builder_block(&mut self, target: *mut Block)
RAII enter. C++ ctor saves builder.currentBlock and sets it to target:
: builder(builder), saved(builder.currentBlock.get()) { builder.currentBlock = NotNull{target}; }
Here we apply the builder mutation (currentBlock = target); the matching
restore (the dtor’s job) is performed by the lowering scope that holds the
saved block (see lower_ast_stat_if / lower_ast_stat_while).
Source§impl CfgBuilder
impl CfgBuilder
Sourcepub fn cfg_builder_block_scope_block_scope(&mut self)
pub fn cfg_builder_block_scope_block_scope(&mut self)
RAII exit. C++ dtor restores the saved block:
~BlockScope() { builder.currentBlock = NotNull{saved}; }
The saved block is not threadable through this nullary signature, so the
restore is performed inline by the lowering scope that owns saved
(lower_ast_stat_if / lower_ast_stat_while). Nothing remains for the
destructor to do here.
Source§impl CfgBuilder
impl CfgBuilder
Sourcepub fn block_scope_block_scope(&mut self)
pub fn block_scope_block_scope(&mut self)
Deleted copy constructor in C++ (= delete). Mirrors the established
@delete convention (e.g. TypedAllocator copy ctor): never called.
Source§impl CfgBuilder
impl CfgBuilder
pub fn new(allocator: *mut CfgAllocator) -> Self
Source§impl CfgBuilder
impl CfgBuilder
Sourcepub fn emit<T, Args>(&mut self, block: *mut Block, args: Args) -> *mut Twhere
Args: IntoInstruction<T>,
T: InstructionMember,
pub fn emit<T, Args>(&mut self, block: *mut Block, args: Args) -> *mut Twhere
Args: IntoInstruction<T>,
T: InstructionMember,
template<typename T, typename... Args> NotNull<T> emit(Block* block, Args&&...).
NotNull<T> -> *mut T.
Source§impl CfgBuilder
impl CfgBuilder
Source§impl CfgBuilder
impl CfgBuilder
pub fn emit_refine_instruction( &mut self, block: *mut Block, refinement: RefinementId, )
Source§impl CfgBuilder
impl CfgBuilder
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_ast_stat(&mut self, statement: *mut AstStat)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_ast_stat_block(&mut self, statement: *mut AstStatBlock)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_ast_stat_local(&mut self, local: *mut AstStatLocal)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_ast_stat_assign(&mut self, assn: *mut AstStatAssign)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_ast_stat_if(&mut self, stat_if: *mut AstStatIf)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_ast_stat_while(&mut self, stat_while: *mut AstStatWhile)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_expr_ast_expr(&mut self, expr: *mut AstExpr)
Source§impl CfgBuilder
impl CfgBuilder
pub fn lower_expr_ast_expr_local(&mut self, local: *mut AstExprLocal)
Source§impl CfgBuilder
impl CfgBuilder
pub fn make_cfg( allocator: *mut CfgAllocator, block: *mut AstStatBlock, ) -> *mut ControlFlowGraph
Source§impl CfgBuilder
impl CfgBuilder
Source§impl CfgBuilder
impl CfgBuilder
pub fn new_definition(&mut self, sym: Symbol) -> DefId
Source§impl CfgBuilder
impl CfgBuilder
pub fn next_version_index(&mut self, sym: Symbol) -> usize
Source§impl CfgBuilder
impl CfgBuilder
pub fn read_variable(&mut self, block: BlockId, sym: Symbol) -> DefId
Source§impl CfgBuilder
impl CfgBuilder
pub fn resolve_condition( &mut self, condition: *mut AstExpr, ) -> Option<RefinementId>
Source§impl CfgBuilder
impl CfgBuilder
Source§impl CfgBuilder
impl CfgBuilder
pub fn trim_trivial_join(&mut self, _j: *mut Join)
Trait Implementations§
Source§impl Clone for CfgBuilder
impl Clone for CfgBuilder
Source§fn clone(&self) -> CfgBuilder
fn clone(&self) -> CfgBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more