FLANG

Public Types | Public Member Functions | List of all members
fir::KindMapping Class Reference

`#include <flang/Optimizer/Support/KindMapping.h>`

## Public Types
using | KindTy = unsigned
using | Bitsize = unsigned
using | LLVMTypeID = llvm::Type::TypeID
using | MatchResult = mlir::ParseResult

## Public Member Functions
| KindMapping (mlir::MLIRContext *context)
| KindMapping (mlir::MLIRContext *context, llvm::StringRef map)
Bitsize | getCharacterBitsize (KindTy kind) const
| Get the size in bits of !fir.char<kind>
Bitsize | getIntegerBitsize (KindTy kind) const
| Get the size in bits of !fir.int<kind>
Bitsize | getLogicalBitsize (KindTy kind) const
| Get the size in bits of !fir.logical<kind>
Bitsize | getRealBitsize (KindTy kind) const
| Get the size in bits of !fir.real<kind>
LLVMTypeID | getRealTypeID (KindTy kind) const
| Get the LLVM Type::TypeID of !fir.real<kind>
LLVMTypeID | getComplexTypeID (KindTy kind) const
| Get the LLVM Type::TypeID of !fir.complex<kind>
mlir::MLIRContext * | getContext () const
const llvm::fltSemantics & | getFloatSemantics (KindTy kind) const
| Get the float semantics of !fir.real<kind>

## Detailed Description

The kind mapping is an encoded string that informs FIR how the Fortran KIND values from the front-end should be converted to LLVM IR types. This encoding allows the mapping from front-end KIND values to backend LLVM IR types to be customized by the front-end.

The provided string uses the following syntax.

intrinsic-key `:` kind-value (`,` intrinsic-key `:` kind-value)*

intrinsic-key is a single character for the intrinsic type. 'i' : INTEGER (size in bits) 'l' : LOGICAL (size in bits) 'a' : CHARACTER (size in bits) 'r' : REAL (encoding value) 'c' : COMPLEX (encoding value)

kind-value is either an unsigned integer (for 'i', 'l', and 'a') or one of 'Half', 'Float', 'Double', 'X86_FP80', or 'FP128' (for 'r' and 'c').

If LLVM adds support for new floating-point types, the final list should be extended.

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

- include/flang/Optimizer/Support/KindMapping.h
- lib/Optimizer/Support/KindMapping.cpp