sun::types::SliceType

sun::types::SliceType

class · Source (opens in a new tab)

class sun::types::SliceType : public sun::types::Type

Slice type: builtin struct for array/matrix indexing Represents a range [start, end) or a single index (when end = start + 1) Used with IIndexable interface for uniform slice handling LLVM representation: { i64 start, i64 end }.

Inherits

Public Functions

SliceType

public · function · Source (opens in a new tab)

sun::types::SliceType::SliceType()=default

Creates an instance with its default state.

equals

public · function · Source (opens in a new tab)

bool sun::types::SliceType::equals(const Type &other) const override

Reports whether the other type has the same semantic identity.

Related: Type

getKind

public · function · Source (opens in a new tab)

Kind sun::types::SliceType::getKind() const override

Returns the type category used for semantic checks and dispatch.

Related: Kind

getSliceStructType

public · function · static · Source (opens in a new tab)

static llvm::StructType * sun::types::SliceType::getSliceStructType(llvm::LLVMContext &ctx)

Get the LLVM struct type for slice: { i64, i64 }.

isSingleIndex

public · function · static · Source (opens in a new tab)

static bool sun::types::SliceType::isSingleIndex(int64_t start, int64_t end)

Helper to check if a slice is a single index (end == start + 1) This is used to distinguish m[5] from m[5:6].

toLLVMType

public · function · Source (opens in a new tab)

llvm::Type * sun::types::SliceType::toLLVMType(llvm::LLVMContext &ctx) const override

Returns the LLVM type used to represent values of this semantic type.

toString

public · function · Source (opens in a new tab)

std::string sun::types::SliceType::toString() const override

Returns a readable representation for diagnostics and debugging.

Public Fields

StaticKind

public · variable · static · Source (opens in a new tab)

Kind sun::types::SliceType::StaticKind = Kind::Slice

No documentation comment.

Related: Kind, Kind::Slice