top | up | prev | next

BoundFunction Class

Definition at line 16 of BoundFunction.hpp

Constructors

BoundFunction(BoundCompileUnit* boundCompileUnit_, FunctionSymbol* functionSymbol_)
BoundFunction(const BoundFunction&) delete

Member Functions

void Accept(BoundNodeVisitor& visitor) override
void AddLabeledStatement(BoundStatement* labeledStatement)
void AddTemporaryDestructorCall(std::unique_ptr<BoundFunctionCall>&& destructorCall, BoundFunction* currentFunction, ContainerScope* currentContainerScope, const Span& span, const boost::uuids::uuid& moduleId)
BoundCompoundStatement* Body() const
const std::vector<std::unique_ptr<BoundStatement>>& EnterCode() const
const std::vector<std::unique_ptr<BoundStatement>>& ExitCode() const
BoundCompileUnit* GetBoundCompileUnit() const
const FunctionSymbol* GetFunctionSymbol() const
FunctionSymbol* GetFunctionSymbol()
BoundStatement* GetLineCode() const
bool HasGotos() const
const std::vector<BoundStatement*>& LabeledStatements() const
void Load(Emitter& emitter, OperationFlags flags) override
void MoveTemporaryDestructorCallsTo(BoundExpression& expression)
void SetBody(std::unique_ptr<BoundCompoundStatement>&& body_)
void SetEnterCode(std::vector<std::unique_ptr<BoundStatement>>&& enterCode_)
void SetExitCode(std::vector<std::unique_ptr<BoundStatement>>&& exitCode_)
void SetHasGotos()
void SetLineCode(std::unique_ptr<BoundStatement>&& lineCode_)
void Store(Emitter& emitter, OperationFlags flags) override
BoundFunction& operator=(const BoundFunction&) delete

Member Variables

std::unique_ptr<BoundCompoundStatement> body
BoundCompileUnit* boundCompileUnit
std::vector<std::unique_ptr<BoundStatement>> enterCode
std::vector<std::unique_ptr<BoundStatement>> exitCode
FunctionSymbol* functionSymbol
bool hasGotos
std::vector<BoundStatement*> labeledStatements
std::unique_ptr<BoundStatement> lineCode
std::vector<std::unique_ptr<LocalVariableSymbol>> temporaries
std::vector<std::unique_ptr<BoundFunctionCall>> temporaryDestructorCalls

Constructor Details

BoundFunction Constructor

cmajor::binder::BoundFunction::BoundFunction(BoundCompileUnit * boundCompileUnit_, FunctionSymbol* functionSymbol_)

Definition at line 19 of BoundFunction.cpp :
 19 :
 20 BoundNode(functionSymbol_->GetSpan()functionSymbol_->SourceModuleId()BoundNodeType::boundFunction)boundCompileUnit(boundCompileUnit_)functionSymbol(functionSymbol_)hasGotos(false)
 21 {
 22 }



BoundFunction Constructor

cmajor::binder::BoundFunction::BoundFunction(const BoundFunction &) delete

Definition at line 20 of BoundFunction.hpp


Member Function Details

Accept Member Function

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

Definition at line 34 of BoundFunction.cpp :
 35 {
 36     visitor.Visit(*this);
 37 }


Declaration at line 24 of BoundFunction.hpp

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

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


AddLabeledStatement Member Function

void cmajor::binder::BoundFunction::AddLabeledStatement(BoundStatement * labeledStatement)

Definition at line 97 of BoundFunction.cpp :
 98 {
 99     labeledStatements.push_back(labeledStatement);
100 }


Declaration at line 34 of BoundFunction.hpp

Called by: cmajor::binder::ControlFlowAnalyzer::CollectLabel


AddTemporaryDestructorCall Member Function

void cmajor::binder::BoundFunction::AddTemporaryDestructorCall(std::unique_ptr<BoundFunctionCall >&& destructorCall, BoundFunction * currentFunction, ContainerScope* currentContainerScope, const Span& span, const boost::uuids::uuid& moduleId)

Definition at line 44 of BoundFunction.cpp

Calls: cmajor::binder::BoundCompileUnit::AddBoundNode , cmajor::binder::BoundCompileUnit::GetClassTemplateRepository , cmajor::binder::BoundCompileUnit::GetModule , cmajor::binder::BoundCompileUnit::GetSymbolTable , cmajor::binder::BoundCompileUnit::InstantiateClassTemplateMemberFunction , cmajor::binder::BoundCompileUnit::IsGeneratedDestructorInstantiated , cmajor::binder::BoundCompileUnit::SetGeneratedDestructorInstantiated , cmajor::binder::BoundFunction::GetBoundCompileUnit , cmajor::binder::BoundFunction::GetFunctionSymbol , cmajor::binder::BoundNode::GetSpan , cmajor::binder::ClassTemplateRepository::BindClassTemplateSpecialization , cmajor::binder::ClassTemplateRepository::Instantiate , cmajor::symbols::Module::GetLock , cmajor::symbols::SymbolTable::CopyClassTemplateSpecialization

Called by: cmajor::binder::ExpressionBinder::BindArrow , cmajor::binder::ExpressionBinder::BindBinaryOp , cmajor::binder::ExpressionBinder::BindUnaryOp , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit


Body Member Function

BoundCompoundStatement * cmajor::binder::BoundFunction::Body() const

Definition at line 28 of BoundFunction.hpp :
28 { return body.get(); }

Called by: cmajor::binder::ControlFlowAnalyzer::Visit


EnterCode Member Function

const std::vector<std::unique_ptr<BoundStatement >>& cmajor::binder::BoundFunction::EnterCode() const

Definition at line 37 of BoundFunction.hpp :
37 { return enterCode; }


ExitCode Member Function

const std::vector<std::unique_ptr<BoundStatement >>& cmajor::binder::BoundFunction::ExitCode() const

Definition at line 39 of BoundFunction.hpp :
39 { return exitCode; }


GetBoundCompileUnit Member Function

BoundCompileUnit * cmajor::binder::BoundFunction::GetBoundCompileUnit() const

Definition at line 42 of BoundFunction.hpp :
42 { return boundCompileUnit; }

Called by: cmajor::binder::BoundFunction::AddTemporaryDestructorCall


GetFunctionSymbol Member Function

const FunctionSymbol * cmajor::binder::BoundFunction::GetFunctionSymbol() const

Definition at line 25 of BoundFunction.hpp :
25 { return functionSymbol; }


GetFunctionSymbol Member Function

FunctionSymbol * cmajor::binder::BoundFunction::GetFunctionSymbol()

Definition at line 26 of BoundFunction.hpp :
26 { return functionSymbol; }

Called by: cmajor::binder::BoundClass::ContainsSourceFunctions , cmajor::binder::BoundFunction::AddTemporaryDestructorCall , cmajor::binder::ExpressionBinder::BindArrow , cmajor::binder::ExpressionBinder::BindBinaryOp , cmajor::binder::ExpressionBinder::BindSymbol , cmajor::binder::ExpressionBinder::BindUnaryOp , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::ExpressionBinder::Visit , cmajor::binder::StatementBinder::GenerateEnterAndExitFunctionCode , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit , cmajor::binder::StatementBinder::Visit


GetLineCode Member Function

BoundStatement * cmajor::binder::BoundFunction::GetLineCode() const

Definition at line 41 of BoundFunction.hpp :
41 { return lineCode.get(); }


HasGotos Member Function

bool cmajor::binder::BoundFunction::HasGotos() const

Definition at line 30 of BoundFunction.hpp :
30 { return hasGotos; }

Called by: cmajor::binder::ControlFlowAnalyzer::Visit


LabeledStatements Member Function

const std::vector<BoundStatement *>& cmajor::binder::BoundFunction::LabeledStatements() const

Definition at line 35 of BoundFunction.hpp :
35 { return labeledStatements; }


Load Member Function

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

Definition at line 24 of BoundFunction.cpp :
 25 {
 26     throw Exception("cannot load from function"GetSpan()ModuleId());
 27 }


Declaration at line 22 of BoundFunction.hpp

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

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


MoveTemporaryDestructorCallsTo Member Function

void cmajor::binder::BoundFunction::MoveTemporaryDestructorCallsTo(BoundExpression & expression)

Definition at line 88 of BoundFunction.cpp :
 89 {
 90     for (std::std::unique_ptr<BoundFunctionCall>&destructorCall : temporaryDestructorCalls)
 91     {
 92         expression.AddTemporaryDestructorCall(std::move(destructorCall));
 93     }
 94     temporaryDestructorCalls.clear();
 95 }


Declaration at line 33 of BoundFunction.hpp

Calls: cmajor::binder::BoundExpression::AddTemporaryDestructorCall

Called by: cmajor::binder::StatementBinder::Visit


SetBody Member Function

void cmajor::binder::BoundFunction::SetBody(std::unique_ptr<BoundCompoundStatement >&& body_)

Definition at line 39 of BoundFunction.cpp :
 40 {
 41     body = std::move(body_);
 42 }


Declaration at line 27 of BoundFunction.hpp


SetEnterCode Member Function

void cmajor::binder::BoundFunction::SetEnterCode(std::vector<std::unique_ptr<BoundStatement >>&& enterCode_)

Definition at line 102 of BoundFunction.cpp :
103 {
104     enterCode = std::move(enterCode_);
105 }


Declaration at line 36 of BoundFunction.hpp

Called by: cmajor::binder::StatementBinder::GenerateEnterAndExitFunctionCode


SetExitCode Member Function

void cmajor::binder::BoundFunction::SetExitCode(std::vector<std::unique_ptr<BoundStatement >>&& exitCode_)

Definition at line 107 of BoundFunction.cpp :
108 {
109     exitCode = std::move(exitCode_);
110 }


Declaration at line 38 of BoundFunction.hpp

Called by: cmajor::binder::StatementBinder::GenerateEnterAndExitFunctionCode


SetHasGotos Member Function

void cmajor::binder::BoundFunction::SetHasGotos()

Definition at line 29 of BoundFunction.hpp :
29 { hasGotos = true; }

Called by: cmajor::binder::StatementBinder::Visit


SetLineCode Member Function

void cmajor::binder::BoundFunction::SetLineCode(std::unique_ptr<BoundStatement >&& lineCode_)

Definition at line 112 of BoundFunction.cpp :
113 {
114     lineCode.reset(lineCode_.release());
115 }


Declaration at line 40 of BoundFunction.hpp

Called by: cmajor::binder::StatementBinder::GenerateEnterAndExitFunctionCode


Store Member Function

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

Definition at line 29 of BoundFunction.cpp :
 30 {
 31     throw Exception("cannot store to function"GetSpan()ModuleId());
 32 }


Declaration at line 23 of BoundFunction.hpp

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

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


operator= Member Function

BoundFunction & cmajor::binder::BoundFunction::operator=(const BoundFunction &) delete

Definition at line 21 of BoundFunction.hpp


top | up | prev | next