This class represents a segment graph for a process. More...
#include <segment_graph.h>
Public Types | |
typedef std::set < SgFunctionDefinition * > | FunctionCallBoundarySet |
typedef std::set< VariantT > | CCxxKeywordsBoundarySet |
typedef std::set < VertexDescriptor > | SegmentSet |
Public Member Functions | |
SegmentGraph (FunctionCallBoundarySet function_boundaries) | |
SegmentGraph (CCxxKeywordsBoundarySet keyword_boundaries) | |
SegmentGraph (FunctionCallBoundarySet function_boundaries, CCxxKeywordsBoundarySet keyword_boundaries) | |
void | clean_graph () |
This function deletes all duplicated nodes in each vertex of the graph. | |
void | print_graph (std::string filename) |
void | print_graph_read_write_access (std::string filename) |
void | add_function (Function *function, bool duplicate_segments=false) |
void | read_write_analysis_of_segments () |
The function determines which variables are read and written in the individual segments. | |
void | set_all_segments_to_untouched () |
This function sets the status of the flag helper_for_graph_algorithms for all nodes to 'Untouched'. | |
bool | has_transition (int seg_id_from, int seg_id_to) |
VertexDescriptor | id_to_vertex_descriptor (int seg_id) |
Public Attributes | |
Graph | graph_ |
Internal data structure of the segment graph. | |
std::set< VertexDescriptor > | precached_function_segments_ |
This set stores segments from precached functions. These segments will be deleted later. | |
std::set< SgFunctionCallExp * > | port_calls_ |
This set stores all function calls which belong to a port. These segments will be deleted later. | |
bool | is_succesfully_created_ |
Is true if the segment graph is successfully created. | |
Private Member Functions | |
void | handle_recursive_calls () |
This function integrates the recursive function calls. | |
void | separate_variable_declaration_and_initializer_on_demand (SgBasicBlock *&bb, bool duplicate_segments) |
void | decompose_expression_with_boundary_calls (SgExpression *expr, SgBasicBlock *&bb, bool duplicate_segments) |
void | create_temp_variable_for_expression (SgExpression *expr, SgBasicBlock *&bb) |
std::string | generate_unique_name (SgNode *node) |
bool | is_boundary_stmt (SgStatement const *const current_stmt) |
SgFunctionCallExp * | has_function_call_with_boundary (SgExpression *expr, bool duplicate_segments) |
bool | should_decompose_function (SgExpression *expr, bool duplicate_segments) |
SgFunctionDeclaration * | contains_function_call_expression (SgExpression *expr) |
SegmentSet | build_graph (SgStatement *current_stmt, SegmentSet current_segments, SegmentSet &break_segments, SegmentSet &continue_segments, bool duplicate_segments) |
void | add_expression_to_segment (SegmentSet segments, SgNode *expr) |
CachedFunctionAstAttributes * | build_segment_graph_for_function (SgFunctionDefinition *func_def, bool duplicate_segments) |
void | insert_loop_edges (VertexDescriptor &loop_vertex, SegmentSet ¤t_segments, SegmentSet &continue_segments, SegmentSet &leaf_segments_of_loop) |
FunctionAnnotationAttributes * | get_function_call_annotation (SgFunctionCallExp *func_call_exp) |
CachedFunctionAstAttributes * | create_cached_function_attribute_for_annotated_function (SgNode *boundary_node, WAIT_CONSTRUCT wait_type, SegmentSet incoming_segments, bool is_conflict_free) |
void | add_mapped_symbol_to_reference (SgFunctionCallExp *func_call, SgFunctionDefinition *func_def) |
void | forward_reference_function_parameters (SgFunctionCallExp *func_call_exp) |
void | mark_not_conflict_free_func_calls_in_segment (SgNode *stmt, SegmentSet segments) |
FunctionAnnotation * | analyze_prepended_pragmas_for_annotation (SgFunctionDeclaration *func_decl) |
SegmentSet | duplicate_segments (SegmentSet segments) |
SegmentSet | duplicate_empty_segments (SegmentSet segments) |
bool | follow_function_call (SgFunctionDeclaration *func_decl) |
Private Attributes | |
bool | static_analysis_ |
FunctionCallBoundarySet | function_boundaries_ |
CCxxKeywordsBoundarySet | keyword_boundaries_ |
std::set< VertexDescriptor > | recursive_function_calls_ |
Static Private Attributes | |
static int | counter = 0 |
This counter is used for generating variables names with unique names. |
This class represents a segment graph for a process.
typedef std::set<VariantT> risc::sg::SegmentGraph::CCxxKeywordsBoundarySet |
typedef std::set<SgFunctionDefinition*> risc::sg::SegmentGraph::FunctionCallBoundarySet |
typedef std::set<VertexDescriptor> risc::sg::SegmentGraph::SegmentSet |
risc::sg::SegmentGraph::SegmentGraph | ( | FunctionCallBoundarySet | function_boundaries | ) |
risc::sg::SegmentGraph::SegmentGraph | ( | CCxxKeywordsBoundarySet | keyword_boundaries | ) |
risc::sg::SegmentGraph::SegmentGraph | ( | FunctionCallBoundarySet | function_boundaries, | |
CCxxKeywordsBoundarySet | keyword_boundaries | |||
) |
void risc::sg::SegmentGraph::add_expression_to_segment | ( | SegmentSet | segments, | |
SgNode * | expr | |||
) | [private] |
void risc::sg::SegmentGraph::add_function | ( | Function * | function, | |
bool | duplicate_segments = false | |||
) |
void risc::sg::SegmentGraph::add_mapped_symbol_to_reference | ( | SgFunctionCallExp * | func_call, | |
SgFunctionDefinition * | func_def | |||
) | [private] |
FunctionAnnotation * risc::sg::SegmentGraph::analyze_prepended_pragmas_for_annotation | ( | SgFunctionDeclaration * | func_decl | ) | [private] |
risc::sg::SegmentGraph::SegmentSet risc::sg::SegmentGraph::build_graph | ( | SgStatement * | current_stmt, | |
SegmentSet | current_segments, | |||
SegmentSet & | break_segments, | |||
SegmentSet & | continue_segments, | |||
bool | duplicate_segments | |||
) | [private] |
risc::sg::CachedFunctionAstAttributes * risc::sg::SegmentGraph::build_segment_graph_for_function | ( | SgFunctionDefinition * | func_def, | |
bool | duplicate_segments | |||
) | [private] |
risc::sg::SegmentGraph::clean_graph | ( | ) |
This function deletes all duplicated nodes in each vertex of the graph.
SgFunctionDeclaration * risc::sg::SegmentGraph::contains_function_call_expression | ( | SgExpression * | expr | ) | [private] |
risc::sg::CachedFunctionAstAttributes * risc::sg::SegmentGraph::create_cached_function_attribute_for_annotated_function | ( | SgNode * | boundary_node, | |
WAIT_CONSTRUCT | wait_type, | |||
SegmentSet | incoming_segments, | |||
bool | is_conflict_free | |||
) | [private] |
void risc::sg::SegmentGraph::create_temp_variable_for_expression | ( | SgExpression * | expr, | |
SgBasicBlock *& | bb | |||
) | [private] |
void risc::sg::SegmentGraph::decompose_expression_with_boundary_calls | ( | SgExpression * | expr, | |
SgBasicBlock *& | bb, | |||
bool | duplicate_segments | |||
) | [private] |
risc::sg::SegmentGraph::SegmentSet risc::sg::SegmentGraph::duplicate_empty_segments | ( | SegmentSet | segments | ) | [private] |
risc::sg::SegmentGraph::SegmentSet risc::sg::SegmentGraph::duplicate_segments | ( | SegmentSet | segments | ) | [private] |
bool risc::sg::SegmentGraph::follow_function_call | ( | SgFunctionDeclaration * | func_decl | ) | [private] |
void risc::sg::SegmentGraph::forward_reference_function_parameters | ( | SgFunctionCallExp * | func_call_exp | ) | [private] |
std::string risc::sg::SegmentGraph::generate_unique_name | ( | SgNode * | node | ) | [private] |
risc::sg::FunctionAnnotationAttributes * risc::sg::SegmentGraph::get_function_call_annotation | ( | SgFunctionCallExp * | func_call_exp | ) | [private] |
risc::sg::SegmentGraph::handle_recursive_calls | ( | ) | [private] |
This function integrates the recursive function calls.
SgFunctionCallExp * risc::sg::SegmentGraph::has_function_call_with_boundary | ( | SgExpression * | expr, | |
bool | duplicate_segments | |||
) | [private] |
bool risc::sg::SegmentGraph::has_transition | ( | int | seg_id_from, | |
int | seg_id_to | |||
) |
risc::sg::VertexDescriptor risc::sg::SegmentGraph::id_to_vertex_descriptor | ( | int | seg_id | ) |
void risc::sg::SegmentGraph::insert_loop_edges | ( | VertexDescriptor & | loop_vertex, | |
SegmentSet & | current_segments, | |||
SegmentSet & | continue_segments, | |||
SegmentSet & | leaf_segments_of_loop | |||
) | [private] |
bool risc::sg::SegmentGraph::is_boundary_stmt | ( | SgStatement const *const | current_stmt | ) | [private] |
void risc::sg::SegmentGraph::mark_not_conflict_free_func_calls_in_segment | ( | SgNode * | stmt, | |
SegmentSet | segments | |||
) | [private] |
void risc::sg::SegmentGraph::print_graph | ( | std::string | filename | ) |
void risc::sg::SegmentGraph::print_graph_read_write_access | ( | std::string | filename | ) |
risc::sg::SegmentGraph::read_write_analysis_of_segments | ( | ) |
The function determines which variables are read and written in the individual segments.
void risc::sg::SegmentGraph::separate_variable_declaration_and_initializer_on_demand | ( | SgBasicBlock *& | bb, | |
bool | duplicate_segments | |||
) | [private] |
risc::sg::SegmentGraph::set_all_segments_to_untouched | ( | ) |
This function sets the status of the flag helper_for_graph_algorithms for all nodes to 'Untouched'.
bool risc::sg::SegmentGraph::should_decompose_function | ( | SgExpression * | expr, | |
bool | duplicate_segments | |||
) | [private] |
int risc::sg::SegmentGraph::counter = 0 [static, private] |
This counter is used for generating variables names with unique names.
Internal data structure of the segment graph.
Is true if the segment graph is successfully created.
std::set<SgFunctionCallExp*> risc::sg::SegmentGraph::port_calls_ |
This set stores all function calls which belong to a port. These segments will be deleted later.
This set stores segments from precached functions. These segments will be deleted later.
std::set<VertexDescriptor> risc::sg::SegmentGraph::recursive_function_calls_ [private] |
bool risc::sg::SegmentGraph::static_analysis_ [private] |