OpenScop
0.9.0
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <osl/macros.h>
#include <osl/scop.h>
#include <osl/statement.h>
#include <osl/relation.h>
#include <osl/names.h>
#include <osl/util.h>
#include <osl/extensions/dependence.h>
Go to the source code of this file.
Functions | |
void | osl_dependence_idump (FILE *file, osl_dependence_p dependence, int level) |
void | osl_dependence_dump (FILE *file, osl_dependence_p dependence) |
void | osl_dependence_print (FILE *file, osl_dependence_p dependence) |
char * | osl_dependence_sprint (osl_dependence_p dependence) |
static osl_dependence_p | osl_dependence_read_one_dep (char **input, int precision) |
osl_dependence_p | osl_dependence_sread (char **input) |
osl_dependence_p | osl_dependence_psread (char **input, int precision) |
osl_dependence_p | osl_dependence_malloc () |
void | osl_dependence_free (osl_dependence_p dependence) |
osl_dependence_p | osl_dependence_nclone (osl_dependence_p dep, int n) |
osl_dependence_p | osl_dependence_clone (osl_dependence_p dep) |
int | osl_dependence_equal (osl_dependence_p d1, osl_dependence_p d2) |
void | osl_dependence_add (osl_dependence_p *start, osl_dependence_p *now, osl_dependence_p dependence) |
int | osl_nb_dependences (osl_dependence_p deps) |
osl_interface_p | osl_dependence_interface () |
void osl_dependence_add | ( | osl_dependence_p * | start, |
osl_dependence_p * | now, | ||
osl_dependence_p | dependence | ||
) |
osl_dependence_add function: This function adds a osl_dependence_p structure (dependence) at a given place (now) of a NULL terminated list of osl_dependence_p structures. The beginning of this list is (start). This function updates (now) to the end of the loop list (loop), and updates (start) if the added element is the first one -that is when (start) is NULL-.
Definition at line 599 of file dependence.c.
References osl_dependence::next.
osl_dependence_clone function: This functions builds and returns a "hard copy" (not a pointer copy) of an osl_dependence_t data structure provided as parameter.
[in] | statement | The pointer to the dependence we want to clone. |
Definition at line 524 of file dependence.c.
References osl_dependence_nclone().
Referenced by osl_dependence_interface().
void osl_dependence_dump | ( | FILE * | file, |
osl_dependence_p | dependence | ||
) |
osl_dependence_dump function: This function prints the content of a osl_dependence_p structure (dependence) into a file (file, possibly stdout).
Definition at line 217 of file dependence.c.
References osl_dependence_idump().
int osl_dependence_equal | ( | osl_dependence_p | d1, |
osl_dependence_p | d2 | ||
) |
osl_dependence_equal function: this function returns true if the two dependences provided as parameters are the same, false otherwise (the usr field is not tested). NOTE: the different pointer to statements or relations are nto compared
[in] | d1 | The first dependence. |
[in] | d2 | The second dependence. |
Definition at line 538 of file dependence.c.
References osl_dependence::depth, osl_dependence::domain, osl_dependence::label_source, osl_dependence::label_target, osl_dependence::next, osl_dependence_equal(), osl_relation_equal(), osl_dependence::ref_source, osl_dependence::ref_target, osl_dependence::source_nb_local_dims_access, osl_dependence::source_nb_local_dims_domain, osl_dependence::source_nb_output_dims_access, osl_dependence::source_nb_output_dims_domain, osl_dependence::target_nb_local_dims_access, osl_dependence::target_nb_local_dims_domain, osl_dependence::target_nb_output_dims_access, osl_dependence::target_nb_output_dims_domain, and osl_dependence::type.
Referenced by osl_dependence_equal(), and osl_dependence_interface().
void osl_dependence_free | ( | osl_dependence_p | dependence | ) |
osl_dependence_free function: This function frees the allocated memory for a osl_dependence_p structure.
Definition at line 449 of file dependence.c.
References osl_dependence::domain, osl_dependence::next, and osl_relation_free().
Referenced by osl_dependence_interface().
void osl_dependence_idump | ( | FILE * | file, |
osl_dependence_p | dependence, | ||
int | level | ||
) |
Most of these functions where extracted from candl and ported to osl osl_dependence_idump function: Displays a osl_dependence_p structure (dependence) into a file (file, possibly stdout) in a way that trends to be understandable without falling in a deep depression or, for the lucky ones, getting a headache... It includes an indentation level (level) in order to work with others idump functions.
Definition at line 92 of file dependence.c.
References osl_dependence::depth, osl_dependence::domain, osl_dependence::label_source, osl_dependence::label_target, osl_statement::next, osl_dependence::next, OSL_DEPENDENCE_RAR, OSL_DEPENDENCE_RAW, OSL_DEPENDENCE_RAW_SCALPRIV, OSL_DEPENDENCE_WAR, OSL_DEPENDENCE_WAW, osl_relation_idump(), osl_statement_idump(), OSL_UNDEFINED, osl_dependence::ref_source, osl_dependence::ref_target, osl_dependence::source_nb_local_dims_access, osl_dependence::source_nb_local_dims_domain, osl_dependence::source_nb_output_dims_access, osl_dependence::source_nb_output_dims_domain, osl_dependence::stmt_source_ptr, osl_dependence::stmt_target_ptr, osl_dependence::target_nb_local_dims_access, osl_dependence::target_nb_local_dims_domain, osl_dependence::target_nb_output_dims_access, osl_dependence::target_nb_output_dims_domain, and osl_dependence::type.
Referenced by osl_dependence_dump(), and osl_dependence_interface().
osl_dependence_interface function: this function creates an interface structure corresponding to the dependence extension and returns it).
Definition at line 641 of file dependence.c.
References osl_dependence_clone(), osl_dependence_equal(), osl_dependence_free(), osl_dependence_idump(), osl_dependence_malloc(), osl_dependence_sprint(), osl_dependence_sread(), osl_interface_malloc(), OSL_strdup, and OSL_URI_DEPENDENCE.
Referenced by osl_interface_get_default_registry().
osl_dependence_malloc function: This function allocates the memory space for a osl_dependence_p structure and sets its fields with default values. Then it returns a pointer to the allocated space.
Definition at line 411 of file dependence.c.
References osl_dependence::depth, osl_dependence::domain, osl_dependence::label_source, osl_dependence::label_target, osl_dependence::next, OSL_malloc, OSL_UNDEFINED, osl_dependence::ref_source, osl_dependence::ref_source_access_ptr, osl_dependence::ref_target, osl_dependence::ref_target_access_ptr, osl_dependence::source_nb_local_dims_access, osl_dependence::source_nb_local_dims_domain, osl_dependence::source_nb_output_dims_access, osl_dependence::source_nb_output_dims_domain, osl_dependence::stmt_source_ptr, osl_dependence::stmt_target_ptr, osl_dependence::target_nb_local_dims_access, osl_dependence::target_nb_local_dims_domain, osl_dependence::target_nb_output_dims_access, osl_dependence::target_nb_output_dims_domain, osl_dependence::type, and osl_dependence::usr.
Referenced by osl_dependence_interface(), osl_dependence_nclone(), and osl_dependence_read_one_dep().
osl_dependence_p osl_dependence_nclone | ( | osl_dependence_p | dep, |
int | n | ||
) |
osl_dependence_nclone function: This function builds and returns a "hard copy" (not a pointer copy) of the n first elements of an osl_dependence_t list.
statement | The pointer to the dependence structure we want to clone. |
n | The number of nodes we want to copy (-1 for infinity). |
Definition at line 473 of file dependence.c.
References osl_dependence::depth, osl_dependence::domain, osl_dependence::label_source, osl_dependence::label_target, osl_dependence::next, osl_dependence_malloc(), osl_relation_clone(), osl_dependence::ref_source, osl_dependence::ref_target, osl_dependence::source_nb_local_dims_access, osl_dependence::source_nb_local_dims_domain, osl_dependence::source_nb_output_dims_access, osl_dependence::source_nb_output_dims_domain, osl_dependence::stmt_source_ptr, osl_dependence::stmt_target_ptr, osl_dependence::target_nb_local_dims_access, osl_dependence::target_nb_local_dims_domain, osl_dependence::target_nb_output_dims_access, osl_dependence::target_nb_output_dims_domain, and osl_dependence::type.
Referenced by osl_dependence_clone().
void osl_dependence_print | ( | FILE * | file, |
osl_dependence_p | dependence | ||
) |
osl_dependence_print function: Print the dependence, formatted to fit the .scop representation.
Definition at line 226 of file dependence.c.
References osl_dependence_sprint().
osl_dependence_p osl_dependence_psread | ( | char ** | input, |
int | precision | ||
) |
osl_dependence_psread function Retrieve a osl_dependence_p list from the option tag in the scop.
Definition at line 371 of file dependence.c.
References osl_dependence::next, OSL_debug, osl_dependence_read_one_dep(), and osl_util_read_int().
Referenced by osl_dependence_sread().
static osl_dependence_p osl_dependence_read_one_dep | ( | char ** | input, |
int | precision | ||
) | [static] |
osl_dependence_read_one_dep function: Read one dependence from a string.
Definition at line 317 of file dependence.c.
References osl_dependence::depth, osl_dependence::domain, osl_dependence::label_source, osl_dependence::label_target, osl_dependence_malloc(), OSL_DEPENDENCE_RAR, OSL_DEPENDENCE_RAW, OSL_DEPENDENCE_RAW_SCALPRIV, OSL_DEPENDENCE_WAR, OSL_DEPENDENCE_WAW, osl_relation_psread(), osl_util_read_int(), osl_util_read_string(), osl_dependence::ref_source, osl_dependence::ref_target, and osl_dependence::type.
Referenced by osl_dependence_psread().
char* osl_dependence_sprint | ( | osl_dependence_p | dependence | ) |
osl_dependence_sprint function: Returns a string containing the dependence, formatted to fit the .scop representation.
Definition at line 238 of file dependence.c.
References osl_dependence::depth, osl_dependence::domain, osl_dependence::label_source, osl_dependence::label_target, osl_dependence::next, OSL_DEPENDENCE_RAR, OSL_DEPENDENCE_RAW, OSL_DEPENDENCE_RAW_SCALPRIV, OSL_DEPENDENCE_WAR, OSL_DEPENDENCE_WAW, OSL_malloc, OSL_MAX_STRING, osl_relation_sprint(), OSL_UNDEFINED, osl_util_safe_strcat(), osl_dependence::ref_source, osl_dependence::ref_target, and osl_dependence::type.
Referenced by osl_dependence_interface(), and osl_dependence_print().
osl_dependence_p osl_dependence_sread | ( | char ** | input | ) |
osl_dependence_sread function: Retrieve a osl_dependence_p list from the option tag in the scop.
Definition at line 361 of file dependence.c.
References osl_dependence_psread(), and osl_util_get_precision().
Referenced by osl_dependence_interface().
int osl_nb_dependences | ( | osl_dependence_p | deps | ) |
osl_nb_dependences function: This function returns the number of dependences in the dependence list
dependence | The first dependence of the dependence list. |
Definition at line 624 of file dependence.c.
References osl_dependence::next.