top | up | prev | next

GlobalVariableSymbol Class

Definition at line 120 of VariableSymbol.hpp

Constructors

GlobalVariableSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)
GlobalVariableSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& groupName_, const std::string& compileUnitId, const std::string& compileUnitFilePath_)

Member Functions

void Accept(SymbolCollector* collector) override
const char* ClassName() const override
const std::string& CompileUnitFilePath() const
void ComputeMangledName() override
void CreateIrObject(Emitter& emitter)
void Dump(CodeFormatter& formatter) override
std::string GetSymbolCategoryDescription() const override
std::string GetSymbolCategoryStr() const override
const std::u32string& GroupName() const
Value* Initializer() const
void* IrObject(Emitter& emitter)
bool IsExportSymbol() const override
bool IsGlobalVariableSymbol() const override
void Read(SymbolReader& reader) override
std::unique_ptr<Symbol> RemoveFromParent() override
void SetGlobalVariableGroup(GlobalVariableGroupSymbol* globalVariableGroup_)
void SetInitializer(std::unique_ptr<Value>&& initializer_)
void SetSpecifiers(Specifiers specifiers)
std::string Syntax() const override
std::string TypeString() const override
void Write(SymbolWriter& writer) override

Member Variables

std::string compileUnitFilePath
GlobalVariableGroupSymbol* globalVariableGroup
std::u32string groupName
std::unique_ptr<Value> initializer

Constructor Details

GlobalVariableSymbol Constructor

cmajor::symbols::GlobalVariableSymbol::GlobalVariableSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)

Definition at line 478 of VariableSymbol.cpp :
478 :
479 VariableSymbol(SymbolType::globalVariableSymbolspan_sourceModuleId_name_)globalVariableGroup(nullptr)
480 {
481 }


Declaration at line 124 of VariableSymbol.hpp


GlobalVariableSymbol Constructor

cmajor::symbols::GlobalVariableSymbol::GlobalVariableSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& groupName_, const std::string& compileUnitId, const std::string& compileUnitFilePath_)

Definition at line 472 of VariableSymbol.cpp :
472 :
473 VariableSymbol(SymbolType::globalVariableSymbolspan_sourceModuleId_MakeGlobalVariableName(groupName_compileUnitId))groupName(groupName_)compileUnitFilePath(compileUnitFilePath_)
474 globalVariableGroup(nullptr)
475 {
476 }


Declaration at line 123 of VariableSymbol.hpp


Member Function Details

Accept Member Function

void cmajor::symbols::GlobalVariableSymbol::Accept(SymbolCollector * collector) override

Definition at line 516 of VariableSymbol.cpp :
517 {
518     if (IsProject() && Access() == SymbolAccess::public_)
519     {
520         collector->AddGlobalVariable(this);
521     }
522 }


Declaration at line 129 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Accept

Calls: cmajor::symbols::Symbol::Access , cmajor::symbols::Symbol::IsProject , cmajor::symbols::SymbolCollector::AddGlobalVariable


ClassName Member Function

const char * cmajor::symbols::GlobalVariableSymbol::ClassName() const override

Definition at line 135 of VariableSymbol.hpp :
135 { return "GlobalVariableSymbol"; }

Base class overridden functions: cmajor::symbols::Symbol::ClassName , cmajor::symbols::VariableSymbol::ClassName


CompileUnitFilePath Member Function

const std::string& cmajor::symbols::GlobalVariableSymbol::CompileUnitFilePath() const

Definition at line 141 of VariableSymbol.hpp :
141 { return compileUnitFilePath; }

Called by: cmajor::symbols::GlobalVariableGroupSymbol::AddGlobalVariable , cmajor::symbols::GlobalVariableGroupSymbol::RemoveGlobalVariable


ComputeMangledName Member Function

void cmajor::symbols::GlobalVariableSymbol::ComputeMangledName() override

Definition at line 547 of VariableSymbol.cpp :
548 {
549     std::u32string mangledName = ToUtf32(TypeString());
550     mangledName.append(1U'_').append(Name());
551     SetMangledName(mangledName);
552 }


Declaration at line 132 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::ComputeMangledName

Calls: cmajor::symbols::GlobalVariableSymbol::TypeString , cmajor::symbols::Symbol::Name , cmajor::symbols::Symbol::SetMangledName


CreateIrObject Member Function

void cmajor::symbols::GlobalVariableSymbol::CreateIrObject(Emitter& emitter)

Definition at line 634 of VariableSymbol.cpp

Calls: cmajor::symbols::GlobalVariableSymbol::IrObject , cmajor::symbols::TypeSymbol::CreateDefaultIrValue , cmajor::symbols::VariableSymbol::GetType


Dump Member Function

void cmajor::symbols::GlobalVariableSymbol::Dump(CodeFormatter& formatter) override

Definition at line 524 of VariableSymbol.cpp :
525 {
526     formatter.WriteLine(ToUtf8(Name()));
527     formatter.WriteLine("group name: " + ToUtf8(groupName));
528     formatter.WriteLine("full name: " + ToUtf8(FullNameWithSpecifiers()));
529     formatter.WriteLine("mangled name: " + ToUtf8(MangledName()));
530     formatter.WriteLine("type: " + ToUtf8(GetType()->FullName()));
531 }


Declaration at line 130 of VariableSymbol.hpp

Calls: cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::FullNameWithSpecifiers , cmajor::symbols::Symbol::MangledName , cmajor::symbols::Symbol::Name , cmajor::symbols::VariableSymbol::GetType


GetSymbolCategoryDescription Member Function

std::string cmajor::symbols::GlobalVariableSymbol::GetSymbolCategoryDescription() const override

Definition at line 145 of VariableSymbol.hpp :
145 { return "global variable"; }

Base class overridden functions: cmajor::symbols::Symbol::GetSymbolCategoryDescription


GetSymbolCategoryStr Member Function

std::string cmajor::symbols::GlobalVariableSymbol::GetSymbolCategoryStr() const override

Definition at line 144 of VariableSymbol.hpp :
144 { return "GV"; }

Base class overridden functions: cmajor::symbols::Symbol::GetSymbolCategoryStr


GroupName Member Function

const std::u32string& cmajor::symbols::GlobalVariableSymbol::GroupName() const

Definition at line 140 of VariableSymbol.hpp :
140 { return groupName; }

Called by: cmajor::symbols::ContainerSymbol::AddMember , cmajor::symbols::ContainerSymbol::AddOwnedMember


Initializer Member Function

Value * cmajor::symbols::GlobalVariableSymbol::Initializer() const

Definition at line 137 of VariableSymbol.hpp :
137 { return initializer.get(); }


IrObject Member Function

void * cmajor::symbols::GlobalVariableSymbol::IrObject(Emitter& emitter)

Definition at line 629 of VariableSymbol.cpp :
630 {
631     return emitter.GetOrInsertGlobal(ToUtf8(MangledName())GetType()->IrType(emitter));
632 }


Calls: cmajor::symbols::Symbol::MangledName , cmajor::symbols::TypeSymbol::IrType , cmajor::symbols::VariableSymbol::GetType

Called by: cmajor::symbols::GlobalVariableSymbol::CreateIrObject


IsExportSymbol Member Function

bool cmajor::symbols::GlobalVariableSymbol::IsExportSymbol() const override

Definition at line 511 of VariableSymbol.cpp :
512 {
513     return VariableSymbol::IsExportSymbol();
514 }


Declaration at line 127 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::IsExportSymbol

Calls: cmajor::symbols::Symbol::IsExportSymbol


IsGlobalVariableSymbol Member Function

bool cmajor::symbols::GlobalVariableSymbol::IsGlobalVariableSymbol() const override

Definition at line 128 of VariableSymbol.hpp :
128 { return true; }

Base class overridden functions: cmajor::symbols::Symbol::IsGlobalVariableSymbol


Read Member Function

void cmajor::symbols::GlobalVariableSymbol::Read(SymbolReader & reader) override

Definition at line 497 of VariableSymbol.cpp
Declaration at line 126 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Read , cmajor::symbols::VariableSymbol::Read

Calls: cmajor::symbols::Symbol::Access , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolReader::GetBinaryReader , cmajor::symbols::VariableSymbol::GetType , cmajor::symbols::VariableSymbol::Read , cmajor::symbols::VariableSymbol::SetType


RemoveFromParent Member Function

std::unique_ptr<Symbol > cmajor::symbols::GlobalVariableSymbol::RemoveFromParent() override

Definition at line 649 of VariableSymbol.cpp
Declaration at line 143 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::RemoveFromParent

Calls: cmajor::symbols::GlobalVariableGroupSymbol::IsEmpty , cmajor::symbols::GlobalVariableGroupSymbol::RemoveGlobalVariable , cmajor::symbols::Symbol::RemoveFromParent


SetGlobalVariableGroup Member Function

void cmajor::symbols::GlobalVariableSymbol::SetGlobalVariableGroup(GlobalVariableGroupSymbol * globalVariableGroup_)

Definition at line 142 of VariableSymbol.hpp :
142 { globalVariableGroup = globalVariableGroup_; }

Called by: cmajor::symbols::GlobalVariableGroupSymbol::AddGlobalVariable


SetInitializer Member Function

void cmajor::symbols::GlobalVariableSymbol::SetInitializer(std::unique_ptr<Value >&& initializer_)

Definition at line 624 of VariableSymbol.cpp :
625 {
626     initializer = std::move(initializer_);
627 }


Declaration at line 136 of VariableSymbol.hpp


SetSpecifiers Member Function

void cmajor::symbols::GlobalVariableSymbol::SetSpecifiers(Specifiers specifiers)

Definition at line 554 of VariableSymbol.cpp
Declaration at line 134 of VariableSymbol.hpp

Calls: cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SetAccess , cmajor::symbols::Symbol::SourceModuleId

Called by: cmajor::symbols::SymbolTable::AddGlobalVariable


Syntax Member Function

std::string cmajor::symbols::GlobalVariableSymbol::Syntax() const override

Definition at line 533 of VariableSymbol.cpp
Declaration at line 133 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Syntax

Calls: cmajor::symbols::Symbol::DocName , cmajor::symbols::Symbol::GetSpecifierStr , cmajor::symbols::VariableSymbol::GetType


TypeString Member Function

std::string cmajor::symbols::GlobalVariableSymbol::TypeString() const override

Definition at line 131 of VariableSymbol.hpp :
131 { return "global_variable"; }

Base class overridden functions: cmajor::symbols::Symbol::TypeString

Called by: cmajor::symbols::GlobalVariableSymbol::ComputeMangledName


Write Member Function

void cmajor::symbols::GlobalVariableSymbol::Write(SymbolWriter & writer) override

Definition at line 483 of VariableSymbol.cpp
Declaration at line 125 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Write , cmajor::symbols::VariableSymbol::Write

Calls: cmajor::symbols::GlobalVariableSymbol::Write , cmajor::symbols::Symbol::Access , cmajor::symbols::SymbolWriter::GetBinaryWriter , cmajor::symbols::VariableSymbol::Write

Called by: cmajor::symbols::GlobalVariableSymbol::Write


top | up | prev | next