top | up | prev | next

Function Class

Definition at line 15 of Function.hpp

Constructors

Function(const Function&) delete
Function(const std::string& name_, FunctionType* type_, Context& context)

Member Functions

BasicBlock* CreateBasicBlock()
BasicBlock* CreateCleanupBasicBlock()
void Finalize()
uint64_t GetNextResultNumber()
Value* GetParam(int index) const
Type* GetType(Context& context) override
std::string Name(Context& context) override
void SetLinkOnce()
void SetMdId(int mdId_)
void Write(CodeFormatter& formatter, Context& context)
Function& operator=(const Function&) delete

Member Variables

std::vector<std::unique_ptr<BasicBlock>> basicBlocks
std::vector<std::unique_ptr<BasicBlock>> cleanupBasicBlocks
std::unique_ptr<BasicBlock> entryBlock
bool linkOnce
int mdId
std::string name
int nextBBNumber
uint64_t nextResultNumber
std::vector<Instruction*> params
FunctionType* type

Constructor Details

Function Constructor

cmsxi::Function::Function(const Function &) delete

Definition at line 19 of Function.hpp


Function Constructor

cmsxi::Function::Function(const std::string& name_, FunctionType * type_, Context & context)

Definition at line 12 of Function.cpp
Declaration at line 18 of Function.hpp


Member Function Details

CreateBasicBlock Member Function

BasicBlock * cmsxi::Function::CreateBasicBlock()

Definition at line 24 of Function.cpp
Declaration at line 21 of Function.hpp


CreateCleanupBasicBlock Member Function

BasicBlock * cmsxi::Function::CreateCleanupBasicBlock()

Definition at line 37 of Function.cpp :
 38 {
 39     BasicBlock* cubb = new BasicBlock(-1);
 40     cleanupBasicBlocks.push_back(std::unique_ptr<BasicBlock>(cubb));
 41     return cubb;
 42 }


Declaration at line 22 of Function.hpp


Finalize Member Function

void cmsxi::Function::Finalize()

Definition at line 44 of Function.cpp
Declaration at line 23 of Function.hpp


GetNextResultNumber Member Function

uint64_t cmsxi::Function::GetNextResultNumber()

Definition at line 24 of Function.hpp :
24 { return nextResultNumber++; }

Called by: cmsxi::Instruction::WriteResult


GetParam Member Function

Value * cmsxi::Function::GetParam(int index) const

Definition at line 61 of Function.cpp :
 62 {
 63     Assert(index >= 0 && index < params.size()"invalid param index");
 64     return params[index];
 65 }


Declaration at line 26 of Function.hpp


GetType Member Function

Type * cmsxi::Function::GetType(Context & context) override

Definition at line 25 of Function.hpp :
25 { return type; }

Base class overridden functions: cmsxi::Value::GetType


Name Member Function

std::string cmsxi::Function::Name(Context & context) override

Definition at line 27 of Function.hpp :
27 { return "@" + name; }

Base class overridden functions: cmsxi::Value::Name


SetLinkOnce Member Function

void cmsxi::Function::SetLinkOnce()

Definition at line 29 of Function.hpp :
29 { linkOnce = true; }


SetMdId Member Function

void cmsxi::Function::SetMdId(int mdId_)

Definition at line 30 of Function.hpp :
30 { mdId = mdId_; }


Write Member Function

void cmsxi::Function::Write(CodeFormatter& formatter, Context & context)

Definition at line 67 of Function.cpp
Declaration at line 28 of Function.hpp

Calls: cmsxi::Type::Name


operator= Member Function

Function & cmsxi::Function::operator=(const Function &) delete

Definition at line 20 of Function.hpp


top | up | prev | next