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>

source

pub fn name() -> &'static str

Returns a name.

source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

source

pub fn builder( context: &'c Context, location: Location<'c> ) -> LLVMFuncOperationBuilder<'c, Unset, Unset, Unset>

Creates a builder.

source

pub fn body(&self) -> Result<RegionRef<'c, '_>, Error>

source

pub fn sym_name(&self) -> Result<StringAttribute<'c>, Error>

source

pub fn set_sym_name(&mut self, value: StringAttribute<'c>)

source

pub fn function_type(&self) -> Result<TypeAttribute<'c>, Error>

source

pub fn set_function_type(&mut self, value: TypeAttribute<'c>)

source

pub fn linkage(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_linkage(&mut self, value: Attribute<'c>)

source

pub fn remove_linkage(&mut self) -> Result<(), Error>

source

pub fn dso_local(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_dso_local(&mut self, value: Attribute<'c>)

source

pub fn remove_dso_local(&mut self) -> Result<(), Error>

source

pub fn c_conv(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_c_conv(&mut self, value: Attribute<'c>)

source

pub fn remove_c_conv(&mut self) -> Result<(), Error>

source

pub fn comdat(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_comdat(&mut self, value: Attribute<'c>)

source

pub fn remove_comdat(&mut self) -> Result<(), Error>

source

pub fn personality(&self) -> Result<FlatSymbolRefAttribute<'c>, Error>

source

pub fn set_personality(&mut self, value: FlatSymbolRefAttribute<'c>)

source

pub fn remove_personality(&mut self) -> Result<(), Error>

source

pub fn garbage_collector(&self) -> Result<StringAttribute<'c>, Error>

source

pub fn set_garbage_collector(&mut self, value: StringAttribute<'c>)

source

pub fn remove_garbage_collector(&mut self) -> Result<(), Error>

source

pub fn passthrough(&self) -> Result<ArrayAttribute<'c>, Error>

source

pub fn set_passthrough(&mut self, value: ArrayAttribute<'c>)

source

pub fn remove_passthrough(&mut self) -> Result<(), Error>

source

pub fn arg_attrs(&self) -> Result<ArrayAttribute<'c>, Error>

source

pub fn set_arg_attrs(&mut self, value: ArrayAttribute<'c>)

source

pub fn remove_arg_attrs(&mut self) -> Result<(), Error>

source

pub fn res_attrs(&self) -> Result<ArrayAttribute<'c>, Error>

source

pub fn set_res_attrs(&mut self, value: ArrayAttribute<'c>)

source

pub fn remove_res_attrs(&mut self) -> Result<(), Error>

source

pub fn function_entry_count(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_function_entry_count(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_function_entry_count(&mut self) -> Result<(), Error>

source

pub fn memory(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_memory(&mut self, value: Attribute<'c>)

source

pub fn remove_memory(&mut self) -> Result<(), Error>

source

pub fn visibility(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_visibility(&mut self, value: Attribute<'c>)

source

pub fn remove_visibility(&mut self) -> Result<(), Error>

source

pub fn arm_streaming(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_arm_streaming(&mut self, value: Attribute<'c>)

source

pub fn remove_arm_streaming(&mut self) -> Result<(), Error>

source

pub fn arm_locally_streaming(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_arm_locally_streaming(&mut self, value: Attribute<'c>)

source

pub fn remove_arm_locally_streaming(&mut self) -> Result<(), Error>

source

pub fn section(&self) -> Result<StringAttribute<'c>, Error>

source

pub fn set_section(&mut self, value: StringAttribute<'c>)

source

pub fn remove_section(&mut self) -> Result<(), Error>

source

pub fn unnamed_addr(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_unnamed_addr(&mut self, value: Attribute<'c>)

source

pub fn remove_unnamed_addr(&mut self) -> Result<(), Error>

source

pub fn alignment(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_alignment(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_alignment(&mut self) -> Result<(), Error>

Trait Implementations§

source§

impl<'c> From<LLVMFuncOperation<'c>> for Operation<'c>

source§

fn from(operation: LLVMFuncOperation<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for LLVMFuncOperation<'c>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.