PointerType

public struct PointerType : IRType
extension PointerType: Equatable

PointerType is used to specify memory locations. Pointers are commonly used to reference objects in memory.

PointerType may have an optional address space attribute defining the numbered address space where the pointed-to object resides. The default address space is number zero. The semantics of non-zero address spaces are target-specific.

Note that LLVM does not permit pointers to void (void*) nor does it permit pointers to labels (label*). Use i8* instead.

  • Retrieves the type of the value being pointed to.

    Declaration

    Swift

    public let pointee: IRType
  • Retrieves the address space where the pointed-to object resides.

    Declaration

    Swift

    public let addressSpace: AddressSpace
  • Creates a PointerType from a pointee type and an optional address space.

    Note

    The context of this type is taken from it’s pointee

    Declaration

    Swift

    public init(pointee: IRType, addressSpace: AddressSpace = .zero)

    Parameters

    pointee

    The type of the pointed-to object.

    addressSpace

    The optional address space where the pointed-to object resides.

  • / Creates a type that simulates a pointer to void (void*).

    Declaration

    Swift

    public static let toVoid: PointerType
  • Retrieves the underlying LLVM type object.

    Declaration

    Swift

    public func asLLVM() -> LLVMTypeRef
  • Declaration

    Swift

    public static func == (lhs: PointerType, rhs: PointerType) -> Bool