IntType
public struct IntType : IRType
extension IntType: Equatable
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 -
Returns the context associated with this type.
Declaration
Swift
public let context: Context -
Creates an integer type with the specified bit width.
Parameters
widthThe width in bits of the integer type
contextThe context to create this type in
-
Retrieves the
i1type.Declaration
Swift
public static let int1: IntType -
Retrieves the
i8type.Declaration
Swift
public static let int8: IntType -
Retrieves the
i16type.Declaration
Swift
public static let int16: IntType -
Retrieves the
i32type.Declaration
Swift
public static let int32: IntType -
Retrieves the
i64type.Declaration
Swift
public static let int64: IntType -
Retrieves the
i128type.Declaration
Swift
public static let int128: IntType -
Retrieves an integer value of this type’s bit width consisting of all zero-bits.
Declaration
Swift
public func zero() -> IRConstantReturn 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.Return Value
A value representing an unsigned integer constant initialized with the given Swift integer value.
-
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.Return Value
A value representing a signed integer constant initialized with the given Swift integer value.
-
Creates a constant integer value of this type parsed from a string.
Parameters
valueA string value containing an integer.
radixThe radix, or base, to use for converting text to an integer value. Defaults to 10.
Return Value
A value representing a constant initialized with the result of parsing the string as a signed integer.
-
Retrieves an integer value of this type’s bit width consisting of all one-bits.
Declaration
Swift
public func allOnes() -> IRConstantReturn 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 -
Declaration
Swift
public static func == (lhs: IntType, rhs: IntType) -> Bool
IntType Structure Reference