sun::types::Type

sun::types::Type

class · Source (opens in a new tab)

class sun::types::Type

Base Type class.

Inherited by

Public Functions

equals

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

virtual bool sun::types::Type::equals(const Type &other) const =0

Reports whether the other type has the same semantic identity.

Related: Type

getKind

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

virtual Kind sun::types::Type::getKind() const =0

Returns the type category used for semantic checks and dispatch.

Related: Kind

isAnyPointer

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

bool sun::types::Type::isAnyPointer() const

Returns true for any pointer-like type (raw or static).

isArray

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

bool sun::types::Type::isArray() const

Reports whether this type represents array values.

isBool

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

bool sun::types::Type::isBool() const

Reports whether this type represents bool values.

isCallable

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

bool sun::types::Type::isCallable() const

Reports whether this value can be invoked as a function.

isChar

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

bool sun::types::Type::isChar() const

Reports whether this type represents char values.

isClass

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

bool sun::types::Type::isClass() const

Reports whether this type represents class values.

isCompound

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

bool sun::types::Type::isCompound() const

Compound types must be passed by reference (classes, interfaces, arrays, payload-carrying enums).

Payload-free enums are NOT compound - they are i32 values and passed by value. Defined out-of-line (needs EnumType).

Related: EnumType

isEnum

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

bool sun::types::Type::isEnum() const

Reports whether this type represents enum values.

isErrorUnion

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

bool sun::types::Type::isErrorUnion() const

Reports whether this type represents error union values.

isFloat32

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

bool sun::types::Type::isFloat32() const

Reports whether this type represents float32 values.

isFloat64

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

bool sun::types::Type::isFloat64() const

Reports whether this type represents float64 values.

isFloatingPoint

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

bool sun::types::Type::isFloatingPoint() const

Reports whether this type represents floating point values.

isFunction

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

bool sun::types::Type::isFunction() const

Convenience checks for composite types.

isInt16

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

bool sun::types::Type::isInt16() const

Reports whether this type represents int16 values.

isInt32

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

bool sun::types::Type::isInt32() const

Reports whether this type represents int32 values.

isInt64

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

bool sun::types::Type::isInt64() const

Reports whether this type represents int64 values.

isInt8

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

bool sun::types::Type::isInt8() const

Reports whether this type represents int8 values.

isIntegral

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

bool sun::types::Type::isIntegral() const

Reports whether this type represents integral values.

isInterface

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

bool sun::types::Type::isInterface() const

Reports whether this type represents interface values.

isLambda

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

bool sun::types::Type::isLambda() const

Reports whether this type represents lambda values.

isModule

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

bool sun::types::Type::isModule() const

Reports whether this type represents module values.

isNullPointer

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

bool sun::types::Type::isNullPointer() const

Reports whether this type represents null pointer values.

isNumeric

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

bool sun::types::Type::isNumeric() const

Reports whether this type represents numeric values.

isPrimitive

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

bool sun::types::Type::isPrimitive() const

char is primitive (passed by value, no ownership) but deliberately not numeric or integral: arithmetic and implicit widening are keyed off isNumeric()/isIntegral(), so leaving it out of those rejects 'a' + 1 and any silent char/integer mixing.

Related: isNumeric()

isRawPointer

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

bool sun::types::Type::isRawPointer() const

Reports whether this type represents raw pointer values.

isReference

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

bool sun::types::Type::isReference() const

Reports whether this type represents reference values.

isSigned

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

bool sun::types::Type::isSigned() const

Reports whether this type represents signed values.

isSlice

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

bool sun::types::Type::isSlice() const

Reports whether this type represents slice values.

isStaticPointer

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

bool sun::types::Type::isStaticPointer() const

Reports whether this type represents static pointer values.

isString

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

bool sun::types::Type::isString() const

Reports whether this type represents string values.

isTypeParameter

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

bool sun::types::Type::isTypeParameter() const

Reports whether this type represents type parameter values.

isUInt16

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

bool sun::types::Type::isUInt16() const

Reports whether this type represents u int16 values.

isUInt32

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

bool sun::types::Type::isUInt32() const

Reports whether this type represents u int32 values.

isUInt64

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

bool sun::types::Type::isUInt64() const

Reports whether this type represents u int64 values.

isUInt8

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

bool sun::types::Type::isUInt8() const

Reports whether this type represents u int8 values.

isUnsigned

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

bool sun::types::Type::isUnsigned() const

Reports whether this type represents unsigned values.

isVoid

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

bool sun::types::Type::isVoid() const

Convenience checks for primitive types.

numericBitWidth

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

int sun::types::Type::numericBitWidth() const

The width in bits of an integer or floating point type, such as 32 for both i32 and f32.

Zero for every other type, including bool and char.

toDisplayString

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

virtual std::string sun::types::Type::toDisplayString() const

User-friendly name for error messages (strips internal prefixes).

toLLVMType

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

virtual llvm::Type * sun::types::Type::toLLVMType(llvm::LLVMContext &ctx) const =0

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

toString

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

virtual std::string sun::types::Type::toString() const =0

Returns a readable representation for diagnostics and debugging.

~Type

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

virtual sun::types::Type::~Type()=default

Destroys this object and releases its owned members.

Public Enums

Kind

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

enum class sun::types::Type::Kind

Identifies the primitive and composite type categories understood by the compiler.

Void

Void

No documentation comment.

Bool

Bool

No documentation comment.

Int8

Int8

No documentation comment.

Int16

Int16

No documentation comment.

Int32

Int32

No documentation comment.

Int64

Int64

No documentation comment.

UInt8

UInt8

No documentation comment.

UInt16

UInt16

No documentation comment.

UInt32

UInt32

No documentation comment.

UInt64

UInt64

No documentation comment.

Float32

Float32

No documentation comment.

Float64

Float64

No documentation comment.

Char

Char

No documentation comment.

Function

Function

No documentation comment.

Lambda

Lambda

No documentation comment.

RawPointer

RawPointer

No documentation comment.

StaticPointer

StaticPointer

No documentation comment.

NullPointer

NullPointer

No documentation comment.

Reference

Reference

No documentation comment.

Class

Class

No documentation comment.

Interface

Interface

No documentation comment.

Enum

Enum

No documentation comment.

TypeParameter

TypeParameter

No documentation comment.

ErrorUnion

ErrorUnion

No documentation comment.

Array

Array

No documentation comment.

Slice

Slice

No documentation comment.

Module

Module

No documentation comment.