pub struct IRBuilder { /* private fields */ }
Expand description
IR Builder for constructing IR
Implementations§
Source§impl IRBuilder
impl IRBuilder
Sourcepub fn add_gate(&mut self, opcode: GateOpcode, operands: Vec<Operand>) -> usize
pub fn add_gate(&mut self, opcode: GateOpcode, operands: Vec<Operand>) -> usize
Add gate instruction
Sourcepub fn add_memory(
&mut self,
operation: MemoryOperation,
address: Operand,
value: Option<Operand>,
) -> usize
pub fn add_memory( &mut self, operation: MemoryOperation, address: Operand, value: Option<Operand>, ) -> usize
Add memory instruction
Sourcepub fn add_control(
&mut self,
operation: ControlOperation,
condition: Option<Operand>,
target: Option<String>,
) -> usize
pub fn add_control( &mut self, operation: ControlOperation, condition: Option<Operand>, target: Option<String>, ) -> usize
Add control instruction
Sourcepub fn add_parallel(
&mut self,
instructions: Vec<IRInstruction>,
sync: SynchronizationType,
) -> usize
pub fn add_parallel( &mut self, instructions: Vec<IRInstruction>, sync: SynchronizationType, ) -> usize
Add parallel region
Sourcepub fn define_symbol(
&mut self,
name: String,
symbol_type: SymbolType,
storage: StorageLocation,
)
pub fn define_symbol( &mut self, name: String, symbol_type: SymbolType, storage: StorageLocation, )
Define symbol
Sourcepub fn generate_label(&mut self) -> String
pub fn generate_label(&mut self) -> String
Generate unique label
Sourcepub fn enter_scope(&mut self) -> usize
pub fn enter_scope(&mut self) -> usize
Enter new scope
Sourcepub fn exit_scope(&mut self)
pub fn exit_scope(&mut self)
Exit current scope
Sourcepub fn build(self) -> IntermediateRepresentation
pub fn build(self) -> IntermediateRepresentation
Build final IR
Auto Trait Implementations§
impl Freeze for IRBuilder
impl RefUnwindSafe for IRBuilder
impl Send for IRBuilder
impl Sync for IRBuilder
impl Unpin for IRBuilder
impl UnwindSafe for IRBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.