ArrayType
public struct ArrayType : IRType
extension ArrayType: Equatable
ArrayType
is a very simple derived type that arranges elements
sequentially in memory. ArrayType
requires a size (number of elements) and
an underlying data type.
-
The type of elements in this array.
Declaration
Swift
public let elementType: IRType
-
The number of elements in this array.
Declaration
Swift
public let count: Int
-
Creates an array type from an underlying element type and count.
Note
The context of this type is taken from it’selementType
Declaration
Swift
public init(elementType: IRType, count: Int)
-
Creates a constant array value from a list of IR values of a common type.
Declaration
Swift
public static func constant(_ values: [IRValue], type: IRType) -> IRConstant
Parameters
values
A list of IR values of the same type.
type
The type of the provided IR values.
Return Value
A constant array value containing the given values.
-
Creates a constant, null terminated array value of UTF-8 bytes from string’s
utf8
member.Declaration
Swift
public static func constant(string: String, in context: Context = .global) -> IRConstant
Parameters
string
A string to create a null terminated array from.
context
The context to create the string in.
Return Value
A null terminated constant array value containing
string.utf8.count + 1
i8’s. -
Retrieves the underlying LLVM type object.
Declaration
Swift
public func asLLVM() -> LLVMTypeRef
-
Declaration
Swift
public static func == (lhs: ArrayType, rhs: ArrayType) -> Bool