PIPS
|
#include "safescale.h"
Go to the source code of this file.
Functions | |
static void | search_sequence_containing (statement s, void *a_context) |
static statement | sequence_statement_containing (statement root_statement, statement searched_stat) |
static bool | statement_is_contained_in_a_sequence_p (statement root_statement, statement searched_stat) |
static void | check_if_statement_contains_comment (statement s, void *a_context) |
Add in the statement containing comments in the list of statements. More... | |
static list | get_statements_with_comments_containing (string comment_portion, statement stat) |
Build a list with statements containing comments. More... | |
static string | get_function_name_by_searching_tag (statement stat, string tag) |
Return the identified function name of the externalized portion of code by searching comment matching tag. More... | |
static void | clean_statement_from_tags (string comment_portion, statement stat) |
static void | remove_begin_tag (statement stat, string function_name) |
Remove begin tag for a given statement and function. More... | |
static void | remove_end_tag (statement stat, string function_name) |
Remove end tag for given statement and function. More... | |
static statement | isolate_code_portion (statement begin_tag_statement, statement end_tag_statement, statement sequence_statement) |
Transform a statement in a sequence statement with a single statement which is the embedded statement that will be distributed. More... | |
static list | identify_statements_to_distribute (statement module_stat) |
Return a list of statements that are marked for externalization. More... | |
bool | safescale_distributor_init (const char *module_name) |
Main phase for block code detection. More... | |
|
static |
Add in the statement containing comments in the list of statements.
Definition at line 78 of file identification.c.
References CONS, STATEMENT, statement_comments, and statement_with_empty_comment_p().
Referenced by get_statements_with_comments_containing().
Definition at line 202 of file identification.c.
References concatenate(), empty_comments, free(), statement_comments, statement_with_empty_comment_p(), and strdup().
Referenced by remove_begin_tag(), and remove_end_tag().
Return the identified function name of the externalized portion of code by searching comment matching tag.
Definition at line 142 of file identification.c.
References free(), gen_nth(), ifdebug, instruction_sequence, instruction_tag, is_instruction_sequence, malloc(), pips_debug, print_statement(), sequence_statements, STATEMENT, statement_comments, statement_instruction, statement_with_empty_comment_p(), and strdup().
Referenced by identify_statements_to_distribute(), and isolate_code_portion().
|
static |
Build a list with statements containing comments.
Set searched string
Reset and get list of statements
Definition at line 98 of file identification.c.
References check_if_statement_contains_comment(), free(), gen_context_recurse, gen_true2(), ifdebug, NIL, pips_debug, pips_user_error, print_statement(), statement_domain, and strdup().
Referenced by identify_statements_to_distribute().
Return a list of statements that are marked for externalization.
Restructure code to avoid imbricated sequences if some portions are found to allow more than one INIT
Identify statements containing a begin tag
Check all statements are contained in a sequence
Definition at line 399 of file identification.c.
References CONS, EXTERNALIZED_CODE_PRAGMA_BEGIN, EXTERNALIZED_CODE_PRAGMA_END, gen_length(), gen_nth(), get_function_name_by_searching_tag(), get_statements_with_comments_containing(), ifdebug, isolate_code_portion(), MAP, NIL, pips_debug, pips_user_warning, print_statement(), sequence_statement_containing(), simple_restructure_statement(), STATEMENT, and statement_is_contained_in_a_sequence_p().
Referenced by safescale_distributor_init().
|
static |
Transform a statement in a sequence statement with a single statement which is the embedded statement that will be distributed.
Count the number of statements to isolate in a single statement
Insert an analyzed tag
Build a new isolated sequence statement
Build a new sequence containing isolated sequence statement
Rebuild the sequence in the good order
Nothing to do, the code is already isolated !
Definition at line 280 of file identification.c.
References concatenate(), CONS, empty_comments, entity_empty_label(), EXTERNALIZED_CODE_PRAGMA_ANALYZED_PREFIX_TOP, EXTERNALIZED_CODE_PRAGMA_ANALYZED_TOP, EXTERNALIZED_CODE_PRAGMA_BEGIN, gen_nreverse(), get_function_name_by_searching_tag(), ifdebug, insert_comments_to_statement(), instruction_sequence, instruction_tag, is_instruction_sequence, make_instruction(), make_sequence(), make_statement(), make_synchronization_none(), malloc(), MAP, NIL, pips_assert, pips_debug, pips_user_warning, print_statement(), remove_begin_tag(), remove_end_tag(), sequence_statements, STATEMENT, statement_extensions, statement_instruction, statement_number, statement_ordering, and strdup().
Referenced by identify_statements_to_distribute().
Remove begin tag for a given statement and function.
Definition at line 252 of file identification.c.
References clean_statement_from_tags(), EXTERNALIZED_CODE_PRAGMA_BEGIN, malloc(), pips_debug, and print_statement().
Referenced by isolate_code_portion().
Remove end tag for given statement and function.
Definition at line 266 of file identification.c.
References clean_statement_from_tags(), EXTERNALIZED_CODE_PRAGMA_END, malloc(), pips_debug, and print_statement().
Referenced by isolate_code_portion().
bool safescale_distributor_init | ( | const char * | module_name | ) |
Main phase for block code detection.
Get the resources
Doi the job
Reorder the module because new statements have been added
Update/release resources
module_name | odule_name |
Definition at line 483 of file identification.c.
References compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, gen_consistent_p(), identify_statements_to_distribute(), module_name(), module_name_to_entity(), module_reorder(), pips_assert, pips_debug, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), and statement_consistent_p().
|
static |
Definition at line 33 of file identification.c.
References instruction_sequence, instruction_tag, is_instruction_sequence, MAP, sequence_statements, STATEMENT, and statement_instruction.
Referenced by sequence_statement_containing().
|
static |
Definition at line 53 of file identification.c.
References gen_context_recurse, gen_true2(), search_sequence_containing(), and statement_domain.
Referenced by identify_statements_to_distribute(), and statement_is_contained_in_a_sequence_p().
|
static |
Definition at line 69 of file identification.c.
References sequence_statement_containing().
Referenced by identify_statements_to_distribute().