pub struct LLVMFuncOperation<'c> { /* private fields */ }
Expand description
A func
operation. LLVM dialect function..
MLIR functions are defined by an operation that is not built into the IR
itself. The LLVM dialect provides an llvm.func
operation to define
functions compatible with LLVM IR. These functions have LLVM dialect
function type but use MLIR syntax to express it. They are required to have
exactly one result type. LLVM function operation is intended to capture
additional properties of LLVM functions, such as linkage and calling
convention, that may be modeled differently by the built-in MLIR function.
// The type of @bar is !llvm<"i64 (i64)">
llvm.func @bar(%arg0: i64) -> i64 {
llvm.return %arg0 : i64
}
// Type type of @foo is !llvm<"void (i64)">
// !llvm.void type is omitted
llvm.func @foo(%arg0: i64) {
llvm.return
}
// A function with `internal` linkage.
llvm.func internal @internal_func() {
llvm.return
}
Implementations§
source§impl<'c> LLVMFuncOperation<'c>
impl<'c> LLVMFuncOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> LLVMFuncOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> LLVMFuncOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn body(&self) -> Result<RegionRef<'c, '_>, Error>
pub fn sym_name(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_sym_name(&mut self, value: StringAttribute<'c>)
pub fn function_type(&self) -> Result<TypeAttribute<'c>, Error>
pub fn set_function_type(&mut self, value: TypeAttribute<'c>)
pub fn linkage(&self) -> Result<Attribute<'c>, Error>
pub fn set_linkage(&mut self, value: Attribute<'c>)
pub fn remove_linkage(&mut self) -> Result<(), Error>
pub fn dso_local(&self) -> Result<Attribute<'c>, Error>
pub fn set_dso_local(&mut self, value: Attribute<'c>)
pub fn remove_dso_local(&mut self) -> Result<(), Error>
pub fn c_conv(&self) -> Result<Attribute<'c>, Error>
pub fn set_c_conv(&mut self, value: Attribute<'c>)
pub fn remove_c_conv(&mut self) -> Result<(), Error>
pub fn comdat(&self) -> Result<Attribute<'c>, Error>
pub fn set_comdat(&mut self, value: Attribute<'c>)
pub fn remove_comdat(&mut self) -> Result<(), Error>
pub fn personality(&self) -> Result<FlatSymbolRefAttribute<'c>, Error>
pub fn set_personality(&mut self, value: FlatSymbolRefAttribute<'c>)
pub fn remove_personality(&mut self) -> Result<(), Error>
pub fn garbage_collector(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_garbage_collector(&mut self, value: StringAttribute<'c>)
pub fn remove_garbage_collector(&mut self) -> Result<(), Error>
pub fn passthrough(&self) -> Result<ArrayAttribute<'c>, Error>
pub fn set_passthrough(&mut self, value: ArrayAttribute<'c>)
pub fn remove_passthrough(&mut self) -> Result<(), Error>
pub fn arg_attrs(&self) -> Result<ArrayAttribute<'c>, Error>
pub fn set_arg_attrs(&mut self, value: ArrayAttribute<'c>)
pub fn remove_arg_attrs(&mut self) -> Result<(), Error>
pub fn res_attrs(&self) -> Result<ArrayAttribute<'c>, Error>
pub fn set_res_attrs(&mut self, value: ArrayAttribute<'c>)
pub fn remove_res_attrs(&mut self) -> Result<(), Error>
pub fn function_entry_count(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_function_entry_count(&mut self, value: IntegerAttribute<'c>)
pub fn remove_function_entry_count(&mut self) -> Result<(), Error>
pub fn memory(&self) -> Result<Attribute<'c>, Error>
pub fn set_memory(&mut self, value: Attribute<'c>)
pub fn remove_memory(&mut self) -> Result<(), Error>
pub fn visibility(&self) -> Result<Attribute<'c>, Error>
pub fn set_visibility(&mut self, value: Attribute<'c>)
pub fn remove_visibility(&mut self) -> Result<(), Error>
pub fn arm_streaming(&self) -> Result<Attribute<'c>, Error>
pub fn set_arm_streaming(&mut self, value: Attribute<'c>)
pub fn remove_arm_streaming(&mut self) -> Result<(), Error>
pub fn arm_locally_streaming(&self) -> Result<Attribute<'c>, Error>
pub fn set_arm_locally_streaming(&mut self, value: Attribute<'c>)
pub fn remove_arm_locally_streaming(&mut self) -> Result<(), Error>
pub fn section(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_section(&mut self, value: StringAttribute<'c>)
pub fn remove_section(&mut self) -> Result<(), Error>
pub fn unnamed_addr(&self) -> Result<Attribute<'c>, Error>
pub fn set_unnamed_addr(&mut self, value: Attribute<'c>)
pub fn remove_unnamed_addr(&mut self) -> Result<(), Error>
pub fn alignment(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_alignment(&mut self, value: IntegerAttribute<'c>)
pub fn remove_alignment(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl<'c> From<LLVMFuncOperation<'c>> for Operation<'c>
impl<'c> From<LLVMFuncOperation<'c>> for Operation<'c>
source§fn from(operation: LLVMFuncOperation<'c>) -> Self
fn from(operation: LLVMFuncOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for LLVMFuncOperation<'c>
impl<'c> !Send for LLVMFuncOperation<'c>
impl<'c> !Sync for LLVMFuncOperation<'c>
impl<'c> Unpin for LLVMFuncOperation<'c>
impl<'c> UnwindSafe for LLVMFuncOperation<'c>
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