sun::types::StaticPointerType
class · Source (opens in a new tab)
class sun::types::StaticPointerType : public sun::types::TypeStatic 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
- sun::types::Type (public)
Public Functions
- StaticPointerType
- equals
- getKind
- getPointeeLLVMType
- getPointeeType
- getStructType
- toDisplayString
- toLLVMType
- toString
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 overrideReports 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 overrideReturns 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) constGet 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() constReturns 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) constGet the LLVM struct type for the fat pointer.
toDisplayString
public · function · Source (opens in a new tab)
std::string sun::types::StaticPointerType::toDisplayString() const overrideReturns 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 overrideReturns fat pointer struct: { ptr data, i64 length }.
toString
public · function · Source (opens in a new tab)
std::string sun::types::StaticPointerType::toString() const overrideReturns 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::StaticPointerNo documentation comment.
Related: Kind, Kind::StaticPointer
Private Fields
cachedLLVMType
private · variable · Source (opens in a new tab)
llvm::StructType* sun::types::StaticPointerType::cachedLLVMType = nullptrNo documentation comment.
pointeeType
private · variable · Source (opens in a new tab)
TypePtr sun::types::StaticPointerType::pointeeTypeNo documentation comment.
Related: TypePtr