Skip to main content

CfgBuilder

Struct CfgBuilder 

Source
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

Source

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

Source

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

Source

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

Source

pub fn new(allocator: *mut CfgAllocator) -> Self

Source§

impl CfgBuilder

Source

pub fn emit<T, Args>(&mut self, block: *mut Block, args: Args) -> *mut T

template<typename T, typename... Args> NotNull<T> emit(Block* block, Args&&...). NotNull<T> -> *mut T.

Source§

impl CfgBuilder

Source

pub fn emit_join(&mut self, block: *mut Block, sym: Symbol) -> *mut Join

Join* CFGBuilder::emitJoin(Block* block, Symbol sym). Reference: ControlFlowGraph.cpp:258-265.

Source§

impl CfgBuilder

Source

pub fn emit_refine_instruction( &mut self, block: *mut Block, refinement: RefinementId, )

Source§

impl CfgBuilder

Source

pub fn fill_join_operands(&mut self, block: *mut Block, j: *mut Join)

Source§

impl CfgBuilder

Source

pub fn is_sealed(&self, b: *mut Block) -> bool

Source§

impl CfgBuilder

Source

pub fn lower_ast_stat(&mut self, statement: *mut AstStat)

Source§

impl CfgBuilder

Source

pub fn lower_ast_stat_block(&mut self, statement: *mut AstStatBlock)

Source§

impl CfgBuilder

Source§

impl CfgBuilder

Source§

impl CfgBuilder

Source

pub fn lower_ast_stat_if(&mut self, stat_if: *mut AstStatIf)

Source§

impl CfgBuilder

Source

pub fn lower_ast_stat_while(&mut self, stat_while: *mut AstStatWhile)

Source§

impl CfgBuilder

Source

pub fn lower_expr_ast_expr(&mut self, expr: *mut AstExpr)

Source§

impl CfgBuilder

Source§

impl CfgBuilder

Source§

impl CfgBuilder

Source

pub fn new_block( &mut self, kind: BlockKind, debug_name: String, pred: *mut Block, ) -> *mut Block

C++ default arg Block* pred = nullptr; callers pass null_mut() to omit.

Source§

impl CfgBuilder

Source

pub fn new_definition(&mut self, sym: Symbol) -> DefId

Source§

impl CfgBuilder

Source

pub fn next_version_index(&mut self, sym: Symbol) -> usize

Source§

impl CfgBuilder

Source

pub fn read_variable(&mut self, block: BlockId, sym: Symbol) -> DefId

Source§

impl CfgBuilder

Source

pub fn resolve_condition( &mut self, condition: *mut AstExpr, ) -> Option<RefinementId>

Source§

impl CfgBuilder

Source

pub fn seal(&mut self, b: *mut Block)

void CFGBuilder::seal(Block* b). Reference: ControlFlowGraph.cpp.

Source§

impl CfgBuilder

Source

pub fn trim_trivial_join(&mut self, _j: *mut Join)

Trait Implementations§

Source§

impl Clone for CfgBuilder

Source§

fn clone(&self) -> CfgBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CfgBuilder

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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