PandA-2024.02
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
InstructionWriter Class Reference

#include <instruction_writer.hpp>

Inheritance diagram for InstructionWriter:
Inheritance graph
[legend]
Collaboration diagram for InstructionWriter:
Collaboration graph
[legend]

Public Member Functions

virtual ~InstructionWriter ()
 Destructor. More...
 
virtual void Initialize ()
 Initialize data structure. More...
 
virtual void write (const FunctionBehaviorConstRef function_behavior, const vertex statement, const var_pp_functorConstRef varFunctor)
 Write a statement. More...
 
virtual void declareFunction (const unsigned int function_id)
 Write the declaration of a function. More...
 
virtual void write_declarations ()
 Write code needed for declaration/initialization of auxiliary variables. More...
 
void WriteComment (const std::string &text)
 Writes a comment. More...
 

Static Public Member Functions

static InstructionWriterRef CreateInstructionWriter (const ActorGraphBackend_Type actor_graph_backend_type, const application_managerConstRef AppM, const IndentedOutputStreamRef indented_output_stream, const ParameterConstRef parameters)
 Factory method. More...
 

Protected Member Functions

 InstructionWriter (const application_managerConstRef AppM, const IndentedOutputStreamRef indented_output_stream, const ParameterConstRef parameters)
 Constructor; it is protected since factory method should be used. More...
 

Protected Attributes

const application_managerConstRef AppM
 The application manager. More...
 
const IndentedOutputStreamRef indented_output_stream
 The indented output stream. More...
 
const ParameterConstRef parameters
 The set of input parameters. More...
 
int debug_level
 The debug level. More...
 

Detailed Description

Definition at line 68 of file instruction_writer.hpp.

Constructor & Destructor Documentation

◆ InstructionWriter()

InstructionWriter::InstructionWriter ( const application_managerConstRef  AppM,
const IndentedOutputStreamRef  indented_output_stream,
const ParameterConstRef  parameters 
)
protected

Constructor; it is protected since factory method should be used.

Parameters
AppMis the application manager
indented_output_streamis the output stream for source code
parametersis the set of input parameters

Definition at line 58 of file instruction_writer.cpp.

References debug_level, GET_CLASS, and parameters.

Referenced by CreateInstructionWriter().

Here is the caller graph for this function:

◆ ~InstructionWriter()

InstructionWriter::~InstructionWriter ( )
virtualdefault

Destructor.

Referenced by CreateInstructionWriter().

Here is the caller graph for this function:

Member Function Documentation

◆ CreateInstructionWriter()

InstructionWriterRef InstructionWriter::CreateInstructionWriter ( const ActorGraphBackend_Type  actor_graph_backend_type,
const application_managerConstRef  AppM,
const IndentedOutputStreamRef  indented_output_stream,
const ParameterConstRef  parameters 
)
static

Factory method.

Parameters
actor_graph_backend_typeis the type of thread model to be considered in backend
AppMis the application manager
indented_output_streamis the output stream
parametersis the set of input parameters

Definition at line 66 of file instruction_writer.cpp.

References BA_NONE, InstructionWriter(), THROW_UNREACHABLE, and ~InstructionWriter().

Referenced by CWriter::CreateCWriter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ declareFunction()

void InstructionWriter::declareFunction ( const unsigned int  function_id)
virtual

Write the declaration of a function.

Parameters
function_idis the index of the function

Reimplemented in HLSInstructionWriter, and discrepancy_instruction_writer.

Definition at line 103 of file instruction_writer.cpp.

References IndentedOutputStream::Append(), AppM, indented_output_stream, and tree_helper::PrintType().

Here is the call graph for this function:

◆ Initialize()

void InstructionWriter::Initialize ( )
virtual

Initialize data structure.

Definition at line 87 of file instruction_writer.cpp.

◆ write()

void InstructionWriter::write ( const FunctionBehaviorConstRef  function_behavior,
const vertex  statement,
const var_pp_functorConstRef  varFunctor 
)
virtual

Write a statement.

Parameters
function_behavioris the function to which the statement belongs
statementis the statement to be printed
varFunctoris the variable functor

Definition at line 91 of file instruction_writer.cpp.

References IndentedOutputStream::Append(), FunctionBehavior::CFG, FunctionBehavior::CGetBehavioralHelper(), FunctionBehavior::CGetOpGraph(), indented_output_stream, and BehavioralHelper::print_vertex().

Here is the call graph for this function:

◆ write_declarations()

void InstructionWriter::write_declarations ( )
virtual

Write code needed for declaration/initialization of auxiliary variables.

Definition at line 112 of file instruction_writer.cpp.

◆ WriteComment()

void InstructionWriter::WriteComment ( const std::string &  text)

Writes a comment.

Parameters
commentis the string to be printed

Definition at line 116 of file instruction_writer.cpp.

References IndentedOutputStream::Append(), and indented_output_stream.

Here is the call graph for this function:

Field Documentation

◆ AppM

const application_managerConstRef InstructionWriter::AppM
protected

◆ debug_level

int InstructionWriter::debug_level
protected

The debug level.

Definition at line 81 of file instruction_writer.hpp.

Referenced by InstructionWriter().

◆ indented_output_stream

const IndentedOutputStreamRef InstructionWriter::indented_output_stream
protected

The indented output stream.

Definition at line 75 of file instruction_writer.hpp.

Referenced by HLSInstructionWriter::declareFunction(), declareFunction(), write(), and WriteComment().

◆ parameters

const ParameterConstRef InstructionWriter::parameters
protected

The set of input parameters.

Definition at line 78 of file instruction_writer.hpp.

Referenced by InstructionWriter().


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

Generated on Mon Feb 12 2024 13:03:55 for PandA-2024.02 by doxygen 1.8.13