pub struct FuncOp { /* private fields */ }Expand description
Equivalent to LLVM’s func operation.
See llvm.func.
§Attribute(s):
Note: Only attributes defined directly as part of this operation are listed here. There may be others, not listed here, defined by interface implementations.
| Name | Static Name Identifier | Type |
|---|---|---|
llvm_func_type | ATTR_KEY_LLVM_FUNC_TYPE | TypeAttr |
llvm_function_linkage | ATTR_KEY_LLVM_FUNCTION_LINKAGE | LinkageAttr |
Implementations§
Source§impl FuncOp
impl FuncOp
Sourcepub fn get_attr_llvm_func_type<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, TypeAttr>>
pub fn get_attr_llvm_func_type<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, TypeAttr>>
Get a Ref to the value of the attribute named llvm_func_type.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_func_type(&self, ctx: &Context, value: TypeAttr)
pub fn set_attr_llvm_func_type(&self, ctx: &Context, value: TypeAttr)
Set the value of the attribute named llvm_func_type.
Sourcepub fn get_attr_llvm_function_linkage<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, LinkageAttr>>
pub fn get_attr_llvm_function_linkage<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, LinkageAttr>>
Get a Ref to the value of the attribute named llvm_function_linkage.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_function_linkage(&self, ctx: &Context, value: LinkageAttr)
pub fn set_attr_llvm_function_linkage(&self, ctx: &Context, value: LinkageAttr)
Set the value of the attribute named llvm_function_linkage.
Source§impl FuncOp
impl FuncOp
Sourcepub fn new(ctx: &mut Context, name: Identifier, ty: TypePtr<FuncType>) -> Self
pub fn new(ctx: &mut Context, name: Identifier, ty: TypePtr<FuncType>) -> Self
Create a new empty FuncOp.
Sourcepub fn get_entry_block(&self, ctx: &Context) -> Option<Ptr<BasicBlock>>
pub fn get_entry_block(&self, ctx: &Context) -> Option<Ptr<BasicBlock>>
Get the entry block (if it exists) of this function.
Sourcepub fn get_or_create_entry_block(&self, ctx: &mut Context) -> Ptr<BasicBlock>
pub fn get_or_create_entry_block(&self, ctx: &mut Context) -> Ptr<BasicBlock>
Get the entry block of this function, creating it if it does not exist.
Trait Implementations§
Source§impl AtMostOneRegionInterface for FuncOp
impl AtMostOneRegionInterface for FuncOp
Source§impl BlockArgRemoval for FuncOp
impl BlockArgRemoval for FuncOp
Source§fn can_remove_block_args(&self, ctx: &Context, block: Ptr<BasicBlock>) -> bool
fn can_remove_block_args(&self, ctx: &Context, block: Ptr<BasicBlock>) -> bool
Returns
true if arguments of block can be safely removed, and false otherwise.Source§impl IsDeclaration for FuncOp
impl IsDeclaration for FuncOp
Source§fn is_declaration(&self, ctx: &Context) -> bool
fn is_declaration(&self, ctx: &Context) -> bool
Check if this global value (variable or function) is a declaration.
Source§impl LlvmSymbolName for FuncOp
impl LlvmSymbolName for FuncOp
Source§impl Op for FuncOp
impl Op for FuncOp
Source§fn get_operation(&self) -> Ptr<Operation>
fn get_operation(&self) -> Ptr<Operation>
Get the underlying IR Operation
Source§fn get_opid_static() -> OpId
fn get_opid_static() -> OpId
Get this Op’s OpId, without self reference.
Source§fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
Get details about the concrete Op type.
Source§impl Parsable for FuncOp
impl Parsable for FuncOp
Source§type Arg = Vec<(Identifier, Location)>
type Arg = Vec<(Identifier, Location)>
Type of the argument that must be passed to the parser.
Source§fn parse<'a>(
state_stream: &mut StateStream<'a>,
results: Self::Arg,
) -> ParseResult<'a, Self::Parsed>
fn parse<'a>( state_stream: &mut StateStream<'a>, results: Self::Arg, ) -> ParseResult<'a, Self::Parsed>
Define a parser using existing combinators and call
into on [Parser::parse_stream] to get the final ParseResult.
Use state_stream.state as necessary.Source§fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>
fn parser<'a>( arg: Self::Arg, ) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>
Get a parser combinator that can work on StateStream as its input.
Source§impl Printable for FuncOp
impl Printable for FuncOp
Source§impl SymbolOpInterface for FuncOp
impl SymbolOpInterface for FuncOp
Source§fn get_symbol_name(&self, ctx: &Context) -> Identifier
fn get_symbol_name(&self, ctx: &Context) -> Identifier
Get the name of the symbol defined by this operation.
Source§fn set_symbol_name(&self, ctx: &mut Context, name: Identifier)
fn set_symbol_name(&self, ctx: &mut Context, name: Identifier)
Set a name for the symbol defined by this operation.
impl AtMostNRegionsInterface<1> for FuncOp
impl Copy for FuncOp
impl Eq for FuncOp
impl IsolatedFromAboveInterface for FuncOp
impl NOpdsInterface<0> for FuncOp
impl NResultsInterface<0> for FuncOp
impl StructuralPartialEq for FuncOp
Auto Trait Implementations§
impl Freeze for FuncOp
impl !RefUnwindSafe for FuncOp
impl Send for FuncOp
impl Sync for FuncOp
impl Unpin for FuncOp
impl UnsafeUnpin for FuncOp
impl !UnwindSafe for FuncOp
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.