top | up | prev | next

GlobalVariable Class

Definition at line 12 of Data.hpp

Constructors

GlobalVariable(Type* type_, const std::string& name_)

Member Functions

Type* GetType(Context& context) override
ConstantValue* Initializer() const
std::string Name(Context& context) override
void SetInitializer(ConstantValue* initializer_)
void SetLinkOnce()
void Write(Context& context, CodeFormatter& formatter)

Member Variables

ConstantValue* initializer
bool linkOnce
std::string name
Type* type

Constructor Details

GlobalVariable Constructor

cmsxi::GlobalVariable::GlobalVariable(Type * type_, const std::string& name_)

Definition at line 13 of Data.cpp :
 13 : type(type_)name(name_)initializer(nullptr)linkOnce(false)
 14 {
 15 }


Declaration at line 15 of Data.hpp


Member Function Details

GetType Member Function

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

Definition at line 22 of Data.cpp :
 23 {
 24     return context.GetPtrType(type);
 25 }


Declaration at line 17 of Data.hpp

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

Calls: cmsxi::Context::GetPtrType

Called by: cmsxi::DataRepository::CreateGlobalStringPtr


Initializer Member Function

ConstantValue * cmsxi::GlobalVariable::Initializer() const

Definition at line 19 of Data.hpp :
19 { return initializer; }


Name Member Function

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

Definition at line 17 of Data.cpp :
 18 {
 19     return name;
 20 }


Declaration at line 16 of Data.hpp

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


SetInitializer Member Function

void cmsxi::GlobalVariable::SetInitializer(ConstantValue * initializer_)

Definition at line 18 of Data.hpp :
18 { initializer = initializer_; }

Called by: cmsxi::DataRepository::CreateGlobalStringPtr


SetLinkOnce Member Function

void cmsxi::GlobalVariable::SetLinkOnce()

Definition at line 21 of Data.hpp :
21 { linkOnce = true; }


Write Member Function

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

Definition at line 27 of Data.cpp
Declaration at line 20 of Data.hpp

Calls: cmsxi::ConstantValue::Name , cmsxi::Type::Name , cmsxi::Value::GetType , cmsxi::Value::IsAggregateValue , cmsxi::Value::IsStringValue


top | up | prev | next