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: TypedHandle<FuncType>,
) -> Self
pub fn new( ctx: &mut Context, name: Identifier, ty: TypedHandle<FuncType>, ) -> Self
Create a new empty FuncOp.
Sourcepub fn get_type(&self, ctx: &Context) -> TypedHandle<FuncType>
pub fn get_type(&self, ctx: &Context) -> TypedHandle<FuncType>
Get the function signature (type).
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§
impl AtMostNRegionsInterface<1> for FuncOp
Source§impl AtMostOneRegionInterface for FuncOp
impl AtMostOneRegionInterface for FuncOp
fn get_region(&self, ctx: &Context) -> Option<Ptr<Region>>
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.impl Copy for FuncOp
impl Eq for FuncOp
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.
impl IsolatedFromAboveInterface for FuncOp
Source§impl LlvmSymbolName for FuncOp
impl LlvmSymbolName for FuncOp
Source§fn llvm_symbol_name(&self, ctx: &Context) -> Option<String>
fn llvm_symbol_name(&self, ctx: &Context) -> Option<String>
Get the original LLVM symbol name, if it’s different from the pliron symbol name.
Source§fn set_llvm_symbol_name(&self, ctx: &Context, name: String)
fn set_llvm_symbol_name(&self, ctx: &Context, name: String)
Set the original LLVM symbol name.
Source§impl NOpdsInterface<0> for FuncOp
impl NOpdsInterface<0> for FuncOp
§fn get_operand_i(&self, ctx: &Context, i: LessThanN<N>) -> Value
fn get_operand_i(&self, ctx: &Context, i: LessThanN<N>) -> Value
Get the
i’th operand.§fn operand_type_i(&self, ctx: &Context, i: LessThanN<N>) -> TypeHandle
fn operand_type_i(&self, ctx: &Context, i: LessThanN<N>) -> TypeHandle
Get the type of the
i’th operand.Source§impl NResultsInterface<0> for FuncOp
impl NResultsInterface<0> for FuncOp
§fn get_result_i(&self, ctx: &Context, i: LessThanN<N>) -> Value
fn get_result_i(&self, ctx: &Context, i: LessThanN<N>) -> Value
Get the
i’th result.§fn result_type_i(&self, ctx: &Context, i: LessThanN<N>) -> TypeHandle
fn result_type_i(&self, ctx: &Context, i: LessThanN<N>) -> TypeHandle
Get the type of the
i’th result.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.
§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§impl Printable for FuncOp
impl Printable for FuncOp
impl StructuralPartialEq for FuncOp
Source§impl SymbolOpInterface for FuncOp
impl SymbolOpInterface for FuncOp
§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.
§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.
Auto Trait Implementations§
impl !RefUnwindSafe for FuncOp
impl !UnwindSafe for FuncOp
impl Freeze for FuncOp
impl Send for FuncOp
impl Sync for FuncOp
impl Unpin for FuncOp
impl UnsafeUnpin 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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.