MLIR 23.0.0git
mlir::abi::ABITypeMapper Class Reference

ABITypeMapper translates mlir::Type values into the llvm::abi::Type hierarchy used by the LLVM ABI Lowering Library. More...

#include "mlir/ABI/ABITypeMapper.h"

Public Member Functions

 ABITypeMapper (const DataLayout &dl)
const llvm::abi::Type * map (mlir::Type type)
 Map an MLIR type to its ABI type representation.
llvm::abi::TypeBuilder & getTypeBuilder ()
 Access the underlying TypeBuilder for advanced use.

Detailed Description

ABITypeMapper translates mlir::Type values into the llvm::abi::Type hierarchy used by the LLVM ABI Lowering Library.

Standard MLIR types (IntegerType, FloatType, IndexType, VectorType, MemRefType) are mapped directly. Dialect-specific types are mapped by querying the MLIR DataLayout for size and alignment.

Callers must supply a DataLayout (typically from the enclosing module) so the mapper can determine sizes and alignments.

The mapper owns a BumpPtrAllocator; all returned abi::Type pointers are valid for the lifetime of the mapper.

Definition at line 39 of file ABITypeMapper.h.

Constructor & Destructor Documentation

◆ ABITypeMapper()

ABITypeMapper::ABITypeMapper ( const DataLayout & dl)
explicit

Definition at line 16 of file ABITypeMapper.cpp.

Member Function Documentation

◆ getTypeBuilder()

llvm::abi::TypeBuilder & mlir::abi::ABITypeMapper::getTypeBuilder ( )
inline

Access the underlying TypeBuilder for advanced use.

Definition at line 48 of file ABITypeMapper.h.

◆ map()

const llvm::abi::Type * ABITypeMapper::map ( mlir::Type type)

Map an MLIR type to its ABI type representation.

Returns nullptr if the type cannot be mapped.

Definition at line 19 of file ABITypeMapper.cpp.


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