OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
TPEF::CodeSymElement Class Reference

#include <CodeSymElement.hh>

Inheritance diagram for TPEF::CodeSymElement:
Inheritance graph
Collaboration diagram for TPEF::CodeSymElement:
Collaboration graph

Public Member Functions

 CodeSymElement ()
 
virtual ~CodeSymElement ()
 
virtual SymbolType type () const
 
InstructionElementreference () const
 
void setReference (InstructionElement *aReference)
 
void setReference (const ReferenceManager::SafePointer *aReference)
 
Word size () const
 
void setSize (Word aSize)
 
- Public Member Functions inherited from TPEF::SymbolElement
 SymbolElement ()
 
virtual ~SymbolElement ()
 
bool absolute () const
 
void setAbsolute (bool anAbsoluteness)
 
SymbolBinding binding () const
 
void setBinding (SymbolBinding aBinding)
 
Chunkname () const
 
void setName (Chunk *aName)
 
void setName (const ReferenceManager::SafePointer *aName)
 
Sectionsection () const
 
void setSection (Section *aSect)
 
void setSection (const ReferenceManager::SafePointer *aSect)
 
- Public Member Functions inherited from TPEF::SectionElement
virtual ~SectionElement ()
 
- Public Member Functions inherited from TPEF::SafePointable
virtual ~SafePointable ()
 

Private Attributes

const ReferenceManager::SafePointerreference_
 Referred object. More...
 
Word size_
 Size of referred object in MAUs. More...
 

Additional Inherited Members

- Public Types inherited from TPEF::SymbolElement
enum  SymbolBinding { STB_LOCAL = 0x0, STB_GLOBAL = 0x1, STB_WEAK = 0x2 }
 Binding types of symbol. More...
 
enum  SymbolType {
  STT_NOTYPE = 0x0, STT_DATA = 0x1, STT_CODE = 0x2, STT_SECTION = 0x3,
  STT_FILE = 0x4, STT_PROCEDURE = 0x5
}
 Type of symbol element. More...
 
- Protected Member Functions inherited from TPEF::SectionElement
 SectionElement ()
 
- Protected Member Functions inherited from TPEF::SafePointable
 SafePointable ()
 

Detailed Description

Code symbol.

Definition at line 46 of file CodeSymElement.hh.

Constructor & Destructor Documentation

◆ CodeSymElement()

TPEF::CodeSymElement::CodeSymElement ( )

Constructor.

Definition at line 44 of file CodeSymElement.cc.

44  :
46  size_(0) {
47 }

◆ ~CodeSymElement()

TPEF::CodeSymElement::~CodeSymElement ( )
virtual

Destructor.

Definition at line 52 of file CodeSymElement.cc.

52  {
53 }

Member Function Documentation

◆ reference()

InstructionElement * TPEF::CodeSymElement::reference ( ) const

Returns object which element refers.

Returns
object which element refers.

Definition at line 71 of file CodeSymElement.cc.

71  {
72  return dynamic_cast<InstructionElement*>(reference_->pointer());
73 }

References TPEF::ReferenceManager::SafePointer::pointer(), and reference_.

Referenced by TTAProgram::TPEFProgramFactory::createLabels(), TPEF::AOutSymbolSectionReader::finalize(), TPEFDumper::section(), TTAProgram::TPEFProgramFactory::seekFunctionStartPoints(), and TPEF::TPEFSymbolSectionWriter::writeValueAndSize().

Here is the call graph for this function:

◆ setReference() [1/2]

void TPEF::CodeSymElement::setReference ( const ReferenceManager::SafePointer aReference)

Sets object which element refers.

Parameters
aReferenceObject which element refers.

Definition at line 91 of file CodeSymElement.cc.

92  {
93  reference_ = aReference;
94 }

References reference_.

◆ setReference() [2/2]

void TPEF::CodeSymElement::setReference ( InstructionElement aReference)

Sets object which element refers.

Parameters
aReferenceObject which element refers.

Definition at line 81 of file CodeSymElement.cc.

81  {
83 }

References reference_, and TPEF::ReferenceManager::SafePointer::replaceReference().

Referenced by TTAProgram::ProgramWriter::createBinary(), LabelManager::createSymbolWithReference(), TPEF::AOutSymbolSectionReader::finalize(), TPEF::AOutSymbolSectionReader::initializeSymbol(), and LabelManager::writeProcedureSymbols().

Here is the call graph for this function:

◆ setSize()

void TPEF::CodeSymElement::setSize ( Word  aSize)

Sets size of referred object in MAUs.

Parameters
aSizeof the referred object in MAUs.

Definition at line 112 of file CodeSymElement.cc.

112  {
113  size_ = aSize;
114 }

References size_.

Referenced by TPEF::AOutSymbolSectionReader::finalize().

◆ size()

Word TPEF::CodeSymElement::size ( ) const

Returns size of the referred object in MAUs.

Returns
Size of the referred object in MAUs.

Definition at line 102 of file CodeSymElement.cc.

102  {
103  return size_;
104 }

References size_.

Referenced by TPEF::AOutSymbolSectionReader::finalize(), and TPEF::TPEFSymbolSectionWriter::writeValueAndSize().

◆ type()

SymbolElement::SymbolType TPEF::CodeSymElement::type ( ) const
virtual

Returns type of the element.

Returns
Type of the element.

Implements TPEF::SymbolElement.

Reimplemented in TPEF::ProcedSymElement.

Definition at line 61 of file CodeSymElement.cc.

61  {
62  return STT_CODE;
63 }

References TPEF::SymbolElement::STT_CODE.

Member Data Documentation

◆ reference_

const ReferenceManager::SafePointer* TPEF::CodeSymElement::reference_
private

Referred object.

Definition at line 62 of file CodeSymElement.hh.

Referenced by reference(), and setReference().

◆ size_

Word TPEF::CodeSymElement::size_
private

Size of referred object in MAUs.

Definition at line 64 of file CodeSymElement.hh.

Referenced by setSize(), and size().


The documentation for this class was generated from the following files:
TPEF::ReferenceManager::SafePointer::replaceReference
static const SafePointer * replaceReference(const SafePointer *old, SafePointable *obj)
TPEF::ReferenceManager::SafePointer::null
static const SafePointer null
The default SafePointer that is used in null references.
Definition: SafePointer.hh:229
TPEF::SymbolElement::SymbolElement
SymbolElement()
Definition: SymbolElement.cc:46
TPEF::ReferenceManager::SafePointer::pointer
SafePointable * pointer() const
TPEF::CodeSymElement::size_
Word size_
Size of referred object in MAUs.
Definition: CodeSymElement.hh:64
TPEF::SymbolElement::STT_CODE
@ STT_CODE
Associated with executable code.
Definition: SymbolElement.hh:69
TPEF::CodeSymElement::reference_
const ReferenceManager::SafePointer * reference_
Referred object.
Definition: CodeSymElement.hh:62