top | up | prev | next

BoundConstant Class

Definition at line 121 of BoundExpression.hpp

Constructors

BoundConstant(const Span& span_, const boost::uuids::uuid& moduleId_, ConstantSymbol* constantSymbol_)

Member Functions

void Accept(BoundNodeVisitor& visitor) override
BoundExpression* Clone() override
ConstantSymbol* GetConstantSymbol()
bool HasValue() const override
void Load(Emitter& emitter, OperationFlags flags) override
void Store(Emitter& emitter, OperationFlags flags) override
std::unique_ptr<Value> ToValue(BoundCompileUnit& boundCompileUnit) const override
std::string TypeString() const override

Member Variables

ConstantSymbol* constantSymbol

Constructor Details

BoundConstant Constructor

cmajor::binder::BoundConstant::BoundConstant(const Span& span_, const boost::uuids::uuid& moduleId_, ConstantSymbol* constantSymbol_)

Definition at line 306 of BoundExpression.cpp :
 306 :
 307 BoundExpression(span_moduleId_BoundNodeType::boundConstantconstantSymbol_->GetType())constantSymbol(constantSymbol_)
 308 {
 309 }



Member Function Details

Accept Member Function

void cmajor::binder::BoundConstant::Accept(BoundNodeVisitor & visitor) override

Definition at line 346 of BoundExpression.cpp :
 347 {
 348     visitor.Visit(*this);
 349 }


Declaration at line 128 of BoundExpression.hpp

Base class overridden functions: cmajor::binder::BoundNode::Accept

Calls: cmajor::binder::BoundNodeVisitor::Visit


Clone Member Function

BoundExpression * cmajor::binder::BoundConstant::Clone() override

Definition at line 311 of BoundExpression.cpp :
 312 {
 313     return new BoundConstant(GetSpan()ModuleId()constantSymbol);
 314 }


Declaration at line 125 of BoundExpression.hpp

Base class overridden functions: cmajor::binder::BoundExpression::Clone

Calls: cmajor::binder::BoundNode::GetSpan , cmajor::binder::BoundNode::ModuleId


GetConstantSymbol Member Function

ConstantSymbol * cmajor::binder::BoundConstant::GetConstantSymbol()

Definition at line 132 of BoundExpression.hpp :
132 { return constantSymbol; }


HasValue Member Function

bool cmajor::binder::BoundConstant::HasValue() const override

Definition at line 129 of BoundExpression.hpp :
129 { return true; }

Base class overridden functions: cmajor::binder::BoundExpression::HasValue


Load Member Function

void cmajor::binder::BoundConstant::Load(Emitter & emitter, OperationFlags flags) override

Definition at line 316 of BoundExpression.cpp
Declaration at line 126 of BoundExpression.hpp

Base class overridden functions: cmajor::ir::GenObject::Load

Calls: cmajor::binder::BoundExpression::DestroyTemporaries , cmajor::binder::BoundNode::GetSpan , cmajor::binder::BoundNode::ModuleId , cmajor::ir::Emitter::SetCurrentDebugLocation , cmajor::ir::Emitter::Stack , cmajor::ir::ValueStack::Push , cmajor::symbols::ConstantSymbol::ArrayIrObject , cmajor::symbols::ConstantSymbol::GetValue , cmajor::symbols::Value::GetValueType , cmajor::symbols::Value::IrValue


Store Member Function

void cmajor::binder::BoundConstant::Store(Emitter & emitter, OperationFlags flags) override

Definition at line 341 of BoundExpression.cpp :
 342 {
 343     throw Exception("cannot store to a constant"GetSpan()ModuleId());
 344 }


Declaration at line 127 of BoundExpression.hpp

Base class overridden functions: cmajor::ir::GenObject::Store

Calls: cmajor::binder::BoundNode::GetSpan , cmajor::binder::BoundNode::ModuleId


ToValue Member Function

std::unique_ptr<Value > cmajor::binder::BoundConstant::ToValue(BoundCompileUnit & boundCompileUnit) const override

Definition at line 131 of BoundExpression.hpp :
131 { return std::unique_ptr<Value>(constantSymbol->GetValue()->Clone()); }

Base class overridden functions: cmajor::binder::BoundExpression::ToValue

Calls: cmajor::symbols::ConstantSymbol::GetValue , cmajor::symbols::Value::Clone


TypeString Member Function

std::string cmajor::binder::BoundConstant::TypeString() const override

Definition at line 130 of BoundExpression.hpp :
130 { return "constant"; }

Base class overridden functions: cmajor::binder::BoundExpression::TypeString


top | up | prev | next