top | up | prev | next

ArrayLengthFunction Class

Definition at line 38 of ArrayTypeSymbol.hpp

Constructors

ArrayLengthFunction(ArrayTypeSymbol* arrayType_)
ArrayLengthFunction(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)

Member Functions

void Check() override
const char* ClassName() const override
std::unique_ptr<Value> ConstructValue(const std::vector<std::unique_ptr<Value>>& argumentValues, const Span& span, const boost::uuids::uuid& moduleId, Value* receiver) const override
void EmplaceType(TypeSymbol* typeSymbol, int index) override
void GenerateCall(Emitter& emitter, std::vector<GenObject*>& genObjects, OperationFlags flags, const Span& span, const boost::uuids::uuid& moduleId) override
bool IsBasicTypeOperation() const override
bool IsCompileTimePrimitiveFunction() const override
void Read(SymbolReader& reader) override
void Write(SymbolWriter& writer) override

Member Variables

ArrayTypeSymbol* arrayType

Constructor Details

ArrayLengthFunction Constructor

cmajor::symbols::ArrayLengthFunction::ArrayLengthFunction(ArrayTypeSymbol * arrayType_)

Definition at line 119 of ArrayTypeSymbol.cpp
Declaration at line 42 of ArrayTypeSymbol.hpp


ArrayLengthFunction Constructor

cmajor::symbols::ArrayLengthFunction::ArrayLengthFunction(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)

Definition at line 114 of ArrayTypeSymbol.cpp :
114 :
115 FunctionSymbol(SymbolType::arrayLengthFunctionSymbolspan_sourceModuleId_name_)arrayType(nullptr)
116 {
117 }


Declaration at line 41 of ArrayTypeSymbol.hpp


Member Function Details

Check Member Function

void cmajor::symbols::ArrayLengthFunction::Check() override

Definition at line 172 of ArrayTypeSymbol.cpp :
173 {
174     FunctionSymbol::Check();
175     if (!arrayType)
176     {
177         throw SymbolCheckException("array length function has no array type"GetSpan()SourceModuleId());
178     }
179 }


Declaration at line 51 of ArrayTypeSymbol.hpp

Base class overridden functions: cmajor::symbols::ContainerSymbol::Check , cmajor::symbols::FunctionSymbol::Check , cmajor::symbols::Symbol::Check

Calls: cmajor::symbols::FunctionSymbol::Check , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SourceModuleId


ClassName Member Function

const char * cmajor::symbols::ArrayLengthFunction::ClassName() const override

Definition at line 50 of ArrayTypeSymbol.hpp :
 50 { return "ArrayLengthFunction"; }

Base class overridden functions: cmajor::symbols::ContainerSymbol::ClassName , cmajor::symbols::FunctionSymbol::ClassName , cmajor::symbols::Symbol::ClassName


ConstructValue Member Function

std::unique_ptr<Value > cmajor::symbols::ArrayLengthFunction::ConstructValue(const std::vector<std::unique_ptr<Value >>& argumentValues, const Span& span, const boost::uuids::uuid& moduleId, Value * receiver) const override

Definition at line 167 of ArrayTypeSymbol.cpp :
168 {
169     return std::unique_ptr<Value>(new LongValue(spanmoduleIdarrayType->Size()));
170 }


Declaration at line 47 of ArrayTypeSymbol.hpp

Base class overridden functions: cmajor::symbols::FunctionSymbol::ConstructValue

Calls: cmajor::symbols::ArrayTypeSymbol::Size


EmplaceType Member Function

void cmajor::symbols::ArrayLengthFunction::EmplaceType(TypeSymbol * typeSymbol, int index) override

Definition at line 146 of ArrayTypeSymbol.cpp
Declaration at line 45 of ArrayTypeSymbol.hpp

Base class overridden functions: cmajor::symbols::FunctionSymbol::EmplaceType , cmajor::symbols::Symbol::EmplaceType

Calls: cmajor::symbols::FunctionSymbol::EmplaceType , cmajor::symbols::Symbol::GetSymbolType


GenerateCall Member Function

void cmajor::symbols::ArrayLengthFunction::GenerateCall(Emitter& emitter, std::vector<GenObject*>& genObjects, OperationFlags flags, const Span& span, const boost::uuids::uuid& moduleId) override

Definition at line 159 of ArrayTypeSymbol.cpp :
160 {
161     emitter.SetCurrentDebugLocation(span);
162     Assert(genObjects.size() == 1"array length needs one object");
163     void* size = emitter.CreateIrValueForULong(arrayType->Size());
164     emitter.Stack().Push(size);
165 }


Declaration at line 46 of ArrayTypeSymbol.hpp

Calls: cmajor::symbols::ArrayTypeSymbol::Size


IsBasicTypeOperation Member Function

bool cmajor::symbols::ArrayLengthFunction::IsBasicTypeOperation() const override

Definition at line 48 of ArrayTypeSymbol.hpp :
 48 { return true; }

Base class overridden functions: cmajor::symbols::FunctionSymbol::IsBasicTypeOperation


IsCompileTimePrimitiveFunction Member Function

bool cmajor::symbols::ArrayLengthFunction::IsCompileTimePrimitiveFunction() const override

Definition at line 49 of ArrayTypeSymbol.hpp :
 49 { return true; }

Base class overridden functions: cmajor::symbols::FunctionSymbol::IsCompileTimePrimitiveFunction


Read Member Function

void cmajor::symbols::ArrayLengthFunction::Read(SymbolReader & reader) override

Definition at line 138 of ArrayTypeSymbol.cpp :
139 {
140     FunctionSymbol::Read(reader);
141     boost::uuids::uuid typeId;
142     reader.GetBinaryReader().ReadUuid(typeId);
143     reader.GetSymbolTable()->EmplaceTypeRequest(readerthistypeId1);
144 }


Declaration at line 44 of ArrayTypeSymbol.hpp

Base class overridden functions: cmajor::symbols::ContainerSymbol::Read , cmajor::symbols::FunctionSymbol::Read , cmajor::symbols::Symbol::Read

Calls: cmajor::symbols::FunctionSymbol::Read , cmajor::symbols::SymbolReader::GetBinaryReader , cmajor::symbols::SymbolReader::GetSymbolTable , cmajor::symbols::SymbolTable::EmplaceTypeRequest


Write Member Function

void cmajor::symbols::ArrayLengthFunction::Write(SymbolWriter & writer) override

Definition at line 132 of ArrayTypeSymbol.cpp :
133 {
134     FunctionSymbol::Write(writer);
135     writer.GetBinaryWriter().Write(arrayType->TypeId());
136 }


Declaration at line 43 of ArrayTypeSymbol.hpp

Base class overridden functions: cmajor::symbols::ContainerSymbol::Write , cmajor::symbols::FunctionSymbol::Write , cmajor::symbols::Symbol::Write

Calls: cmajor::symbols::ArrayLengthFunction::Write , cmajor::symbols::FunctionSymbol::Write , cmajor::symbols::SymbolWriter::GetBinaryWriter , cmajor::symbols::TypeSymbol::TypeId

Called by: cmajor::symbols::ArrayLengthFunction::Write


top | up | prev | next