Types


ArrayType

CIR array type

Syntax:

!cir.array<
  mlir::Type,   # eltType
  uint64_t   # size
>

CIR.array represents C/C++ constant arrays.

Parameters:

Parameter C++ type Description
eltType mlir::Type  
size uint64_t  

BoolType

CIR bool type

cir.bool represent's C++ bool type.

ExceptionInfoType

CIR exception info

Syntax: !cir.eh.info

Represents the content necessary for a cir.call to pass back an exception object pointer + some extra selector information. This type is required for some exception related operations, like cir.catch, cir.eh.selector_slot and cir.eh.slot.

FuncType

CIR function type

Syntax:

!cir.func<
  ::llvm::ArrayRef<Type>,   # inputs
  Type,   # returnType
  bool   # varArg
>

The !cir.func is a function type. It consists of a single return type, a list of parameter types and can optionally be variadic.

Example:

!cir.func<!bool ()>
!cir.func<!s32i (!s8i, !s8i)>
!cir.func<!s32i (!s32i, ...)>

Parameters:

Parameter C++ type Description
inputs ::llvm::ArrayRef<Type>  
returnType Type  
varArg bool  

IntType

Integer type with arbitrary precision up to a fixed limit

CIR type that represents C/C++ primitive integer types. Said types are: char, short, int, long, long long, and their
unsigned variations.

Parameters:

Parameter C++ type Description
width unsigned  
isSigned bool  

PointerType

CIR pointer type

CIR.ptr is a type returned by any op generating a pointer in C++.

Parameters:

Parameter C++ type Description
pointee mlir::Type  

VectorType

CIR vector type

Syntax:

!cir.vector<
  mlir::Type,   # eltType
  uint64_t   # size
>

`cir.vector' represents fixed-size vector types. The parameters are the element type and the number of elements.

Parameters:

Parameter C++ type Description
eltType mlir::Type  
size uint64_t  

VoidType

CIR void type

Syntax: !cir.void

The !cir.void type represents the C/C++ void type.