MLIR  14.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::LLVM::LLVMFunctionType Class Reference

LLVM dialect function type. More...

#include "mlir/Dialect/LLVMIR/LLVMTypes.h"

Inheritance diagram for mlir::LLVM::LLVMFunctionType:
Inheritance graph
[legend]
Collaboration diagram for mlir::LLVM::LLVMFunctionType:
Collaboration graph
[legend]

Public Member Functions

bool isVarArg () const
 Returns whether the function is variadic. More...
 
LLVMFunctionType clone (TypeRange inputs, TypeRange results) const
 Returns a clone of this function type with the given argument and result types. More...
 
Type getReturnType ()
 Returns the result type of the function. More...
 
ArrayRef< TypegetReturnTypes ()
 Returns the result type of the function as an ArrayRef, enabling better integration with generic MLIR utilities. More...
 
unsigned getNumParams ()
 Returns the number of arguments to the function. More...
 
Type getParamType (unsigned i)
 Returns i-th argument of the function. Asserts on out-of-bounds. More...
 
ArrayRef< TypegetParams ()
 Returns a list of argument types of the function. More...
 
ArrayRef< Typeparams ()
 

Static Public Member Functions

static bool isValidArgumentType (Type type)
 Checks if the given type can be used an argument in a function type. More...
 
static bool isValidResultType (Type type)
 Checks if the given type can be used as a result in a function type. More...
 
static LLVMFunctionType get (Type result, ArrayRef< Type > arguments, bool isVarArg=false)
 Gets or creates an instance of LLVM dialect function in the same context as the result type. More...
 
static LLVMFunctionType getChecked (function_ref< InFlightDiagnostic()> emitError, Type result, ArrayRef< Type > arguments, bool isVarArg=false)
 
static LogicalResult verify (function_ref< InFlightDiagnostic()> emitError, Type result, ArrayRef< Type > arguments, bool)
 Verifies that the type about to be constructed is well-formed. More...
 
- Static Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
static TypeID getTypeID ()
 Return a unique identifier for the concrete type. More...
 
template<typename T >
static bool classof (T val)
 Provide an implementation of 'classof' that compares the type id of the provided value with that of the concrete type. More...
 
static detail::InterfaceMap getInterfaceMap ()
 Returns an interface map for the interfaces registered to this storage user. More...
 
static HasTraitFn getHasTraitFn ()
 Returns the function that returns true if the given Trait ID matches the IDs of any of the traits defined by the storage user. More...
 
template<typename... IfaceModels>
static void attachInterface (MLIRContext &context)
 Attach the given models as implementations of the corresponding interfaces for the concrete storage user class. More...
 
template<typename... Args>
static ConcreteT get (MLIRContext *ctx, Args... args)
 Get or create a new ConcreteT instance within the ctx. More...
 
template<typename... Args>
static ConcreteT getChecked (const Location &loc, Args... args)
 Get or create a new ConcreteT instance within the ctx, defined at the given, potentially unknown, location. More...
 
template<typename... Args>
static ConcreteT getChecked (function_ref< InFlightDiagnostic()> emitErrorFn, MLIRContext *ctx, Args... args)
 Get or create a new ConcreteT instance within the ctx. More...
 
static ConcreteT getFromOpaquePointer (const void *ptr)
 Get an instance of the concrete type from a void pointer. More...
 

Additional Inherited Members

- Public Types inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
using Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits... >
 Utility declarations for the concrete attribute class. More...
 
using ImplType = StorageT
 
using HasTraitFn = bool(*)(TypeID)
 
- Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
template<typename... Args>
LogicalResult mutate (Args &&...args)
 Mutate the current storage instance. More...
 
ImplTypegetImpl () const
 Utility for easy access to the storage instance. More...
 
- Static Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
template<typename... Args>
static LogicalResult verify (Args... args)
 Default implementation that just returns success. More...
 

Detailed Description

LLVM dialect function type.

It consists of a single return type (unlike MLIR which can have multiple), a list of parameter types and can optionally be variadic.

Definition at line 123 of file LLVMTypes.h.

Member Function Documentation

◆ clone()

LLVMFunctionType LLVMFunctionType::clone ( TypeRange  inputs,
TypeRange  results 
) const

Returns a clone of this function type with the given argument and result types.

Definition at line 116 of file LLVMTypes.cpp.

◆ get()

LLVMFunctionType LLVMFunctionType::get ( Type  result,
ArrayRef< Type arguments,
bool  isVarArg = false 
)
static

◆ getChecked()

LLVMFunctionType LLVMFunctionType::getChecked ( function_ref< InFlightDiagnostic()>  emitError,
Type  result,
ArrayRef< Type arguments,
bool  isVarArg = false 
)
static

◆ getNumParams()

unsigned LLVMFunctionType::getNumParams ( )

◆ getParams()

ArrayRef< Type > LLVMFunctionType::getParams ( )

◆ getParamType()

Type LLVMFunctionType::getParamType ( unsigned  i)

Returns i-th argument of the function. Asserts on out-of-bounds.

Definition at line 131 of file LLVMTypes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by parseShuffleVectorOp(), printLLVMFuncOp(), and verify().

◆ getReturnType()

Type LLVMFunctionType::getReturnType ( )

◆ getReturnTypes()

ArrayRef< Type > LLVMFunctionType::getReturnTypes ( )

Returns the result type of the function as an ArrayRef, enabling better integration with generic MLIR utilities.

Definition at line 123 of file LLVMTypes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

◆ isValidArgumentType()

bool LLVMFunctionType::isValidArgumentType ( Type  type)
static

Checks if the given type can be used an argument in a function type.

Definition at line 93 of file LLVMTypes.cpp.

References mlir::Type::isa().

◆ isValidResultType()

bool LLVMFunctionType::isValidResultType ( Type  type)
static

Checks if the given type can be used as a result in a function type.

Definition at line 97 of file LLVMTypes.cpp.

References mlir::Type::isa().

◆ isVarArg()

bool LLVMFunctionType::isVarArg ( ) const

◆ params()

ArrayRef<Type> mlir::LLVM::LLVMFunctionType::params ( )
inline

Definition at line 167 of file LLVMTypes.h.

References mlir::emitError(), and mlir::verify().

◆ verify()

LogicalResult LLVMFunctionType::verify ( function_ref< InFlightDiagnostic()>  emitError,
Type  result,
ArrayRef< Type arguments,
bool   
)
static

Verifies that the type about to be constructed is well-formed.

Definition at line 142 of file LLVMTypes.cpp.

References mlir::emitError(), and mlir::success().


The documentation for this class was generated from the following files: