sun::types::StaticPointerType

sun::types::StaticPointerType

class · Source (opens in a new tab)

class sun::types::StaticPointerType : public sun::types::Type

Static pointer type - pointer to immortal static data (string literals, globals) Type annotation: static_ptr<T> where T is the pointee type Memory safe: never freed, always valid, read-only Represented as a fat pointer struct: { ptr data, i64 length } Can implicitly convert to raw_ptr<T> for function calls (extracts data ptr).

Inherits

Public Functions

StaticPointerType

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

sun::types::StaticPointerType::StaticPointerType(TypePtr pointee)

Creates a pointer type referring to storage with static lifetime.

Related: TypePtr

equals

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

bool sun::types::StaticPointerType::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::StaticPointerType::getKind() const override

Returns the type category used for semantic checks and dispatch.

Related: Kind

getPointeeLLVMType

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

llvm::Type * sun::types::StaticPointerType::getPointeeLLVMType(llvm::LLVMContext &ctx) const

Get the LLVM type of the pointee (for load/store operations).

getPointeeType

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

const TypePtr & sun::types::StaticPointerType::getPointeeType() const

Returns the pointee type stored by this object.

Related: TypePtr

getStructType

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

llvm::StructType * sun::types::StaticPointerType::getStructType(llvm::LLVMContext &ctx) const

Get the LLVM struct type for the fat pointer.

toDisplayString

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

std::string sun::types::StaticPointerType::toDisplayString() const override

Returns a source-facing type name without internal compiler prefixes.

toLLVMType

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

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

Returns fat pointer struct: { ptr data, i64 length }.

toString

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

std::string sun::types::StaticPointerType::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::StaticPointerType::StaticKind = Kind::StaticPointer

No documentation comment.

Related: Kind, Kind::StaticPointer

Private Fields

cachedLLVMType

private · variable · Source (opens in a new tab)

llvm::StructType* sun::types::StaticPointerType::cachedLLVMType = nullptr

No documentation comment.

pointeeType

private · variable · Source (opens in a new tab)

TypePtr sun::types::StaticPointerType::pointeeType

No documentation comment.

Related: TypePtr