decompiler 1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::SectionVector Class Reference

A collection of named p-code sections for a single Constructor. More...

#include <slgh_compile.hh>

Public Member Functions

 SectionVector (ConstructTpl *rtl, SymbolScope *scope)
 Constructor. More...
 
 ~SectionVector (void)
 Destructor.
 
ConstructTpl * releaseMainSection (void)
 Get the main section, giving up ownership. More...
 
ConstructTpl * releaseNamedSection (int4 index)
 Get a named section by index, giving up ownership. More...
 
RtlPair getMainPair (void) const
 Get the main section/namespace pair.
 
RtlPair getNamedPair (int4 i) const
 Get a named section/namespace pair by index.
 
void setNextIndex (int4 i)
 Set the index of the currently parsing named section.
 
int4 getMaxId (void) const
 Get the maximum (exclusive) named section index.
 
void append (ConstructTpl *rtl, SymbolScope *scope)
 Add a new named section. More...
 

Private Attributes

int4 nextindex
 Index of the section currently being parsed.
 
RtlPair main
 The main section.
 
vector< RtlPairnamed
 Named sections accessed by index.
 

Detailed Description

A collection of named p-code sections for a single Constructor.

A Constructor always has a main section of p-code (which may be empty). Alternately a Constructor may define additional named sections of p-code. Operations in these sections are emitted using the crossbuild directive and can be incorporated into following instructions.

Internally different sections (RtlPair) are identified by index. A SectionSymbol holds the section's name and its corresponding index.

Constructor & Destructor Documentation

◆ SectionVector()

ghidra::SectionVector::SectionVector ( ConstructTpl *  rtl,
SymbolScope *  scope 
)

Constructor.

This must be constructed with the main section of p-code, which can contain no p-code

Parameters
rtlis the main section of p-code
scopeis the symbol scope associated with the section

References main, nextindex, ghidra::RtlPair::scope, and ghidra::RtlPair::section.

Member Function Documentation

◆ append()

void ghidra::SectionVector::append ( ConstructTpl *  rtl,
SymbolScope *  scope 
)

Add a new named section.

Associate the new section with nextindex, established prior to parsing

Parameters
rtlis the named section of p-code
scopeis the associated symbol scope

References named, and nextindex.

Referenced by ghidra::SleighCompile::finalNamedSection(), and ghidra::SleighCompile::nextNamedSection().

◆ releaseMainSection()

ConstructTpl * ghidra::SectionVector::releaseMainSection ( void  )

Get the main section, giving up ownership.

Returns
the p-code template for the main section

References main, and ghidra::RtlPair::section.

Referenced by ghidra::SleighCompile::buildConstructor().

◆ releaseNamedSection()

ConstructTpl * ghidra::SectionVector::releaseNamedSection ( int4  index)

Get a named section by index, giving up ownership.

Parameters
indexis the index of the requested section
Returns
the p-code template for the section

References named.

Referenced by ghidra::SleighCompile::buildConstructor().


The documentation for this class was generated from the following files: