sun::types::Type
class · Source (opens in a new tab)
class sun::types::TypeBase Type class.
Inherited by
- sun::types::ArrayType (public)
- sun::types::ErrorUnionType (public)
- sun::types::FunctionType (public)
- sun::types::LambdaType (public)
- sun::types::ModuleType (public)
- sun::types::NominalType (public)
- sun::types::NullPointerType (public)
- sun::types::PrimitiveType (public)
- sun::types::RawPointerType (public)
- sun::types::ReferenceType (public)
- sun::types::SliceType (public)
- sun::types::StaticPointerType (public)
- sun::types::TypeParameterType (public)
Public Functions
- equals
- getKind
- isAnyPointer
- isArray
- isBool
- isCallable
- isChar
- isClass
- isCompound
- isEnum
- isErrorUnion
- isFloat32
- isFloat64
- isFloatingPoint
- isFunction
- isInt16
- isInt32
- isInt64
- isInt8
- isIntegral
- isInterface
- isLambda
- isModule
- isNullPointer
- isNumeric
- isPrimitive
- isRawPointer
- isReference
- isSigned
- isSlice
- isStaticPointer
- isString
- isTypeParameter
- isUInt16
- isUInt32
- isUInt64
- isUInt8
- isUnsigned
- isVoid
- numericBitWidth
- toDisplayString
- toLLVMType
- toString
- ~Type
equals
public · function · Source (opens in a new tab)
virtual bool sun::types::Type::equals(const Type &other) const =0Reports 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 =0Returns 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() constReturns true for any pointer-like type (raw or static).
isArray
public · function · Source (opens in a new tab)
bool sun::types::Type::isArray() constReports whether this type represents array values.
isBool
public · function · Source (opens in a new tab)
bool sun::types::Type::isBool() constReports whether this type represents bool values.
isCallable
public · function · Source (opens in a new tab)
bool sun::types::Type::isCallable() constReports whether this value can be invoked as a function.
isChar
public · function · Source (opens in a new tab)
bool sun::types::Type::isChar() constReports whether this type represents char values.
isClass
public · function · Source (opens in a new tab)
bool sun::types::Type::isClass() constReports whether this type represents class values.
isCompound
public · function · Source (opens in a new tab)
bool sun::types::Type::isCompound() constCompound 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() constReports whether this type represents enum values.
isErrorUnion
public · function · Source (opens in a new tab)
bool sun::types::Type::isErrorUnion() constReports whether this type represents error union values.
isFloat32
public · function · Source (opens in a new tab)
bool sun::types::Type::isFloat32() constReports whether this type represents float32 values.
isFloat64
public · function · Source (opens in a new tab)
bool sun::types::Type::isFloat64() constReports whether this type represents float64 values.
isFloatingPoint
public · function · Source (opens in a new tab)
bool sun::types::Type::isFloatingPoint() constReports whether this type represents floating point values.
isFunction
public · function · Source (opens in a new tab)
bool sun::types::Type::isFunction() constConvenience checks for composite types.
isInt16
public · function · Source (opens in a new tab)
bool sun::types::Type::isInt16() constReports whether this type represents int16 values.
isInt32
public · function · Source (opens in a new tab)
bool sun::types::Type::isInt32() constReports whether this type represents int32 values.
isInt64
public · function · Source (opens in a new tab)
bool sun::types::Type::isInt64() constReports whether this type represents int64 values.
isInt8
public · function · Source (opens in a new tab)
bool sun::types::Type::isInt8() constReports whether this type represents int8 values.
isIntegral
public · function · Source (opens in a new tab)
bool sun::types::Type::isIntegral() constReports whether this type represents integral values.
isInterface
public · function · Source (opens in a new tab)
bool sun::types::Type::isInterface() constReports whether this type represents interface values.
isLambda
public · function · Source (opens in a new tab)
bool sun::types::Type::isLambda() constReports whether this type represents lambda values.
isModule
public · function · Source (opens in a new tab)
bool sun::types::Type::isModule() constReports whether this type represents module values.
isNullPointer
public · function · Source (opens in a new tab)
bool sun::types::Type::isNullPointer() constReports whether this type represents null pointer values.
isNumeric
public · function · Source (opens in a new tab)
bool sun::types::Type::isNumeric() constReports whether this type represents numeric values.
isPrimitive
public · function · Source (opens in a new tab)
bool sun::types::Type::isPrimitive() constchar 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() constReports whether this type represents raw pointer values.
isReference
public · function · Source (opens in a new tab)
bool sun::types::Type::isReference() constReports whether this type represents reference values.
isSigned
public · function · Source (opens in a new tab)
bool sun::types::Type::isSigned() constReports whether this type represents signed values.
isSlice
public · function · Source (opens in a new tab)
bool sun::types::Type::isSlice() constReports whether this type represents slice values.
isStaticPointer
public · function · Source (opens in a new tab)
bool sun::types::Type::isStaticPointer() constReports whether this type represents static pointer values.
isString
public · function · Source (opens in a new tab)
bool sun::types::Type::isString() constReports whether this type represents string values.
isTypeParameter
public · function · Source (opens in a new tab)
bool sun::types::Type::isTypeParameter() constReports whether this type represents type parameter values.
isUInt16
public · function · Source (opens in a new tab)
bool sun::types::Type::isUInt16() constReports whether this type represents u int16 values.
isUInt32
public · function · Source (opens in a new tab)
bool sun::types::Type::isUInt32() constReports whether this type represents u int32 values.
isUInt64
public · function · Source (opens in a new tab)
bool sun::types::Type::isUInt64() constReports whether this type represents u int64 values.
isUInt8
public · function · Source (opens in a new tab)
bool sun::types::Type::isUInt8() constReports whether this type represents u int8 values.
isUnsigned
public · function · Source (opens in a new tab)
bool sun::types::Type::isUnsigned() constReports whether this type represents unsigned values.
isVoid
public · function · Source (opens in a new tab)
bool sun::types::Type::isVoid() constConvenience checks for primitive types.
numericBitWidth
public · function · Source (opens in a new tab)
int sun::types::Type::numericBitWidth() constThe 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() constUser-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 =0Returns 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 =0Returns a readable representation for diagnostics and debugging.
~Type
public · function · Source (opens in a new tab)
virtual sun::types::Type::~Type()=defaultDestroys this object and releases its owned members.
Public Enums
Kind
public · enum · Source (opens in a new tab)
enum class sun::types::Type::KindIdentifies 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.