pub struct BasicBlock {
pub attributes: AttributeDict,
/* private fields */
}Fields§
§attributes: AttributeDictA dictionary of attributes.
Implementations§
Source§impl BasicBlock
impl BasicBlock
Sourcepub fn new(
ctx: &mut Context,
label: Option<Identifier>,
arg_types: Vec<Ptr<TypeObj>>,
) -> Ptr<BasicBlock>
pub fn new( ctx: &mut Context, label: Option<Identifier>, arg_types: Vec<Ptr<TypeObj>>, ) -> Ptr<BasicBlock>
Create a new Basic Block.
Sourcepub fn get_parent_region(&self) -> Option<Ptr<Region>>
pub fn get_parent_region(&self) -> Option<Ptr<Region>>
Get parent region.
Sourcepub fn get_argument(&self, arg_idx: usize) -> Value
pub fn get_argument(&self, arg_idx: usize) -> Value
Get idx’th argument as a Value.
Sourcepub fn add_argument(&mut self, ty: Ptr<TypeObj>) -> usize
pub fn add_argument(&mut self, ty: Ptr<TypeObj>) -> usize
Add a new argument with specified type. Returns idx at which it was added.
Sourcepub fn get_num_arguments(&self) -> usize
pub fn get_num_arguments(&self) -> usize
Get the number of arguments.
Sourcepub fn has_succ(&self, ctx: &Context, succ: Ptr<BasicBlock>) -> bool
pub fn has_succ(&self, ctx: &Context, succ: Ptr<BasicBlock>) -> bool
Is succ a successor of this block?
Sourcepub fn get_terminator(&self, ctx: &Context) -> Option<Ptr<Operation>>
pub fn get_terminator(&self, ctx: &Context) -> Option<Ptr<Operation>>
Get the block terminator, if one exists.
Sourcepub fn drop_all_uses(ptr: Ptr<Self>, ctx: &Context)
pub fn drop_all_uses(ptr: Ptr<Self>, ctx: &Context)
Drop all uses that this block holds.
Trait Implementations§
Source§impl ContainsLinkedList<BasicBlock> for Region
impl ContainsLinkedList<BasicBlock> for Region
Source§impl ContainsLinkedList<Operation> for BasicBlock
impl ContainsLinkedList<Operation> for BasicBlock
Source§impl LinkedList for BasicBlock
impl LinkedList for BasicBlock
Source§fn get_next(&self) -> Option<Ptr<Self>>
fn get_next(&self) -> Option<Ptr<Self>>
Simple getter for the item previous to this in the list.
Source§fn get_prev(&self) -> Option<Ptr<Self>>
fn get_prev(&self) -> Option<Ptr<Self>>
Simple getter for the item previous to this in the list.
Source§fn get_container(&self) -> Option<Ptr<Self::ContainerType>>
fn get_container(&self) -> Option<Ptr<Self::ContainerType>>
Get a reference to the object that contains this linked list.
Source§impl Located for BasicBlock
impl Located for BasicBlock
Source§impl Named for BasicBlock
impl Named for BasicBlock
fn given_name(&self, _ctx: &Context) -> Option<Identifier>
fn id(&self, _ctx: &Context) -> Identifier
fn unique_name(&self, ctx: &Context) -> Identifier
Source§impl Parsable for BasicBlock
impl Parsable for BasicBlock
Source§fn parse<'a>(
state_stream: &mut StateStream<'a>,
_arg: Self::Arg,
) -> ParseResult<'a, Self::Parsed>
fn parse<'a>( state_stream: &mut StateStream<'a>, _arg: Self::Arg, ) -> ParseResult<'a, Self::Parsed>
A basic block is label(arg_1: type_1, …, arg_n: type_n): op_1; … ; op_n
Source§type Parsed = Ptr<BasicBlock>
type Parsed = Ptr<BasicBlock>
The type of the parsed entity.
Source§fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<StateStream<'a>, Output = Self::Parsed, PartialState = ()> + 'a>
fn parser<'a>( arg: Self::Arg, ) -> Box<dyn Parser<StateStream<'a>, Output = Self::Parsed, PartialState = ()> + 'a>
Get a parser combinator that can work on StateStream as its input.
Source§impl PartialEq for BasicBlock
impl PartialEq for BasicBlock
Auto Trait Implementations§
impl Freeze for BasicBlock
impl !RefUnwindSafe for BasicBlock
impl Send for BasicBlock
impl Sync for BasicBlock
impl Unpin for BasicBlock
impl !UnwindSafe for BasicBlock
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.