IntType
public struct IntType: IRType
The IntType represents an integral value of a specified bit width.
The IntType is a very simple type that simply specifies an arbitrary bit
width for the integer type desired. Any bit width from 1 bit to (2^23)-1
(about 8 million) can be specified.
-
Retrieves the bit width of this integer type.
Declaration
Swift
public let width: Int -
Creates an integer type with the specified bit width.
Declaration
Swift
public init(width: Int) -
Retrieves the
i1type.Declaration
Swift
public static let int1 = IntType(width: 1) -
Retrieves the
i8type.Declaration
Swift
public static let int8 = IntType(width: 8) -
Retrieves the
i16type.Declaration
Swift
public static let int16 = IntType(width: 16) -
Retrieves the
i32type.Declaration
Swift
public static let int32 = IntType(width: 32) -
Retrieves the
i64type.Declaration
Swift
public static let int64 = IntType(width: 64) -
Retrieves the
i128type.Declaration
Swift
public static let int128 = IntType(width: 128) -
Retrieves an integer value of this type’s bit width consisting of all zero-bits.
Declaration
Swift
public func zero() -> IRValueReturn Value
A value consisting of all zero-bits of this type’s bit width.
-
Creates an unsigned integer constant value with the given Swift integer value.
Declaration
Parameters
valueA Swift integer value.
signExtendWhether to sign-extend this value to fit this type’s bit width. Defaults to
false. -
Creates a signed integer constant value with the given Swift integer value.
Declaration
Parameters
valueA Swift integer value.
signExtendWhether to sign-extend this value to fit this type’s bit width. Defaults to
false. -
Retrieves an integer value of this type’s bit width consisting of all one-bits.
Declaration
Swift
public func allOnes() -> IRValueReturn Value
A value consisting of all one-bits of this type’s bit width.
-
Retrieves the underlying LLVM type object.
Declaration
Swift
public func asLLVM() -> LLVMTypeRef
IntType Struct Reference