top | up | prev | next

BoundConversion Class

Definition at line 388 of BoundExpression.hpp

Constructors

BoundConversion(std::unique_ptr<BoundExpression>&& sourceExpr_, FunctionSymbol* conversionFun_)

Member Functions

void Accept(BoundNodeVisitor& visitor) override
void AddTemporary(std::unique_ptr<BoundLocalVariable>&& temporary)
BoundExpression* Clone() override
bool ContainsExceptionCapture() const override
FunctionSymbol* ConversionFun()
bool HasValue() const override
bool IsLvalueExpression() const override
void Load(Emitter& emitter, OperationFlags flags) override
BoundExpression* SourceExpr()
void Store(Emitter& emitter, OperationFlags flags) override
std::unique_ptr<Value> ToValue(BoundCompileUnit& boundCompileUnit) const override
std::string TypeString() const override

Member Variables

FunctionSymbol* conversionFun
std::unique_ptr<BoundExpression> sourceExpr
std::vector<std::unique_ptr<BoundLocalVariable>> temporaries

Constructor Details

BoundConversion Constructor

cmajor::binder::BoundConversion::BoundConversion(std::unique_ptr<BoundExpression >&& sourceExpr_, FunctionSymbol* conversionFun_)

Definition at line 1408 of BoundExpression.cpp :
1408 :
1409 BoundExpression(sourceExpr_->GetSpan()sourceExpr_->ModuleId()BoundNodeType::boundConversionconversionFun_->ConversionTargetType())sourceExpr(std::move(sourceExpr_))conversionFun(conversionFun_)
1410 {
1411     sourceExpr->MoveTemporaryDestructorCallsTo(*this);
1412 }



Member Function Details

Accept Member Function

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

Definition at line 1457 of BoundExpression.cpp :
1458 {
1459     visitor.Visit(*this);
1460 }


Declaration at line 395 of BoundExpression.hpp

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

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


AddTemporary Member Function

void cmajor::binder::BoundConversion::AddTemporary(std::unique_ptr<BoundLocalVariable >&& temporary)

Definition at line 1414 of BoundExpression.cpp :
1415 {
1416     temporaries.push_back(std::move(temporary));
1417 }


Declaration at line 403 of BoundExpression.hpp

Called by: cmajor::binder::BoundConversion::Clone


Clone Member Function

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

Definition at line 1419 of BoundExpression.cpp :
1420 {
1421     std::unique_ptr<BoundExpression> clonedSourceExpr;
1422     clonedSourceExpr.reset(sourceExpr->Clone());
1423     BoundConversion* clone = new BoundConversion(std::move(clonedSourceExpr)conversionFun);
1424     for (const auto& p : temporaries)
1425     {
1426         clone->AddTemporary(std::unique_ptr<BoundLocalVariable>(static_cast<BoundLocalVariable*>(p->Clone())));
1427     }
1428     return clone;
1429 }


Declaration at line 392 of BoundExpression.hpp

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

Calls: cmajor::binder::BoundConversion::AddTemporary , cmajor::binder::BoundConversion::Clone

Called by: cmajor::binder::BoundConversion::Clone


ContainsExceptionCapture Member Function

bool cmajor::binder::BoundConversion::ContainsExceptionCapture() const override

Definition at line 1472 of BoundExpression.cpp :
1473 {
1474     if (BoundExpression::ContainsExceptionCapture())
1475     {
1476         return true;
1477     }
1478     return sourceExpr->ContainsExceptionCapture();
1479 }


Declaration at line 402 of BoundExpression.hpp

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

Calls: cmajor::binder::BoundConversion::ContainsExceptionCapture , cmajor::binder::BoundExpression::ContainsExceptionCapture

Called by: cmajor::binder::BoundConversion::ContainsExceptionCapture


ConversionFun Member Function

FunctionSymbol * cmajor::binder::BoundConversion::ConversionFun()

Definition at line 400 of BoundExpression.hpp :
400 { return conversionFun; }


HasValue Member Function

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

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

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


IsLvalueExpression Member Function

bool cmajor::binder::BoundConversion::IsLvalueExpression() const override

Definition at line 1449 of BoundExpression.cpp :
1450 {
1451     if (conversionFun->GetSymbolType() == SymbolType::conversionFunctionSymbol) return true;
1452     if (conversionFun->IsClassToInterfaceTypeConversion()) return true;
1453     if (conversionFun->IsMemberFunctionToClassDelegateConversion()) return true;
1454     return false;
1455 }


Declaration at line 397 of BoundExpression.hpp

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

Calls: cmajor::symbols::FunctionSymbol::IsClassToInterfaceTypeConversion , cmajor::symbols::FunctionSymbol::IsMemberFunctionToClassDelegateConversion , cmajor::symbols::Symbol::GetSymbolType


Load Member Function

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

Definition at line 1431 of BoundExpression.cpp
Declaration at line 393 of BoundExpression.hpp

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

Calls: cmajor::binder::BoundConversion::Load , cmajor::binder::BoundExpression::DestroyTemporaries , cmajor::binder::BoundExpression::GetType , cmajor::binder::BoundNode::GetSpan , cmajor::binder::BoundNode::ModuleId , cmajor::ir::GenObject::SetType , cmajor::symbols::FunctionSymbol::GenerateCall

Called by: cmajor::binder::BoundConversion::Load


SourceExpr Member Function

BoundExpression * cmajor::binder::BoundConversion::SourceExpr()

Definition at line 399 of BoundExpression.hpp :
399 { return sourceExpr.get(); }


Store Member Function

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

Definition at line 1444 of BoundExpression.cpp :
1445 {
1446     throw Exception("cannot store to a conversion"GetSpan()ModuleId());
1447 }


Declaration at line 394 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::BoundConversion::ToValue(BoundCompileUnit & boundCompileUnit) const override

Definition at line 1462 of BoundExpression.cpp :
1463 {
1464     std::unique_ptr<Value> sourceValue = sourceExpr->ToValue(boundCompileUnit);
1465     if (sourceValue)
1466     {
1467         return conversionFun->ConvertValue(sourceValue);
1468     }
1469     return std::unique_ptr<Value>();
1470 }


Declaration at line 401 of BoundExpression.hpp

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

Calls: cmajor::binder::BoundConversion::ToValue , cmajor::symbols::FunctionSymbol::ConvertValue

Called by: cmajor::binder::BoundConversion::ToValue


TypeString Member Function

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

Definition at line 398 of BoundExpression.hpp :
398 { return "conversion"; }

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


top | up | prev | next