OpenScop
0.9.0
|
#include <stdio.h>
#include <osl/relation.h>
#include <osl/relation_list.h>
#include <osl/names.h>
#include <osl/interface.h>
#include <osl/generic.h>
#include "body.h"
#include "extensions/extbody.h"
Go to the source code of this file.
typedef struct osl_statement* osl_statement_p |
Definition at line 98 of file statement.h.
typedef struct osl_statement osl_statement_t |
Definition at line 97 of file statement.h.
void osl_statement_add | ( | osl_statement_p * | location, |
osl_statement_p | statement | ||
) |
osl_statement_add function: this function adds a statement "statement" at the end of the statement list pointed by "location".
[in,out] | location | Address of the first element of the statement list. |
[in] | statement | The statement to add to the list. |
Definition at line 556 of file statement.c.
References osl_scop::statement.
osl_statement_p osl_statement_clone | ( | osl_statement_p | statement | ) |
osl_statement_clone function: This functions builds and returns a "hard copy" (not a pointer copy) of an osl_statement_t data structure provided as parameter.
[in] | statement | The pointer to the statement we want to clone. |
Definition at line 628 of file statement.c.
References osl_statement_nclone().
Referenced by osl_scop_clone().
void osl_statement_compact | ( | osl_statement_p | , |
int | |||
) |
void osl_statement_dump | ( | FILE * | file, |
osl_statement_p | statement | ||
) |
osl_statement_dump function: this function prints the content of an osl_statement_t structure (*statement) into a file (file, possibly stdout).
[in] | file | The file where the information has to be printed. |
[in] | statement | The statement whose information has to be printed. |
Definition at line 160 of file statement.c.
References osl_statement_idump().
int osl_statement_equal | ( | osl_statement_p | s1, |
osl_statement_p | s2 | ||
) |
osl_statement_equal function: this function returns true if the two statements provided as parameters are the same, false otherwise (the usr field is not tested).
[in] | s1 | The first statement. |
[in] | s2 | The second statement. |
Definition at line 641 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_statement::next, osl_generic_equal(), OSL_info, osl_relation_equal(), osl_relation_list_equal(), osl_statement_equal(), and osl_statement::scattering.
Referenced by osl_scop_equal(), and osl_statement_equal().
void osl_statement_free | ( | osl_statement_p | statement | ) |
osl_statement_free function: this function frees the allocated memory for an osl_statement_t structure.
[in,out] | statement | The pointer to the statement we want to free. |
Definition at line 528 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_statement::next, osl_scop::next, osl_generic_free(), osl_relation_free(), osl_relation_list_free(), and osl_statement::scattering.
Referenced by osl_scop_free().
void osl_statement_get_attributes | ( | osl_statement_p | statement, |
int * | nb_parameters, | ||
int * | nb_iterators, | ||
int * | nb_scattdims, | ||
int * | nb_localdims, | ||
int * | array_id | ||
) |
osl_statement_get_attributes function: this function returns, through its parameters, the maximum values of the relation attributes (nb_iterators, nb_parameters etc) in the statement. HOWEVER, it updates the parameter value iff the attribute is greater than the input parameter value. Hence it may be used to get the attributes as well as to find the maximum attributes for several statement lists. The array identifier 0 is used when there is no array identifier (AND this is OK), OSL_UNDEFINED is used to report it is impossible to provide the property while it should. This function is not intended for checking, the input statement should be correct.
[in] | statement | The statement to extract attributes values. |
[in,out] | nb_parameters | Number of parameter attribute. |
[in,out] | nb_iterators | Number of iterators attribute. |
[in,out] | nb_scattdims | Number of scattering dimensions attribute. |
[in,out] | nb_localdims | Number of local dimensions attribute. |
[in,out] | array_id | Maximum array identifier attribute. |
Definition at line 785 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::next, OSL_max, osl_relation_get_attributes(), osl_relation_list_get_attributes(), OSL_UNDEFINED, and osl_statement::scattering.
Referenced by osl_scop_get_attributes(), and osl_statement_names().
osl_body_p osl_statement_get_body | ( | osl_statement_p | statement | ) |
osl_statement_get_body function: this function returns the body of the statement.
[in] | statement | The statement to search the body. |
Definition at line 835 of file statement.c.
References osl_extbody::body, osl_statement::extension, osl_generic_lookup(), OSL_URI_BODY, and OSL_URI_EXTBODY.
int osl_statement_get_nb_iterators | ( | osl_statement_p | statement | ) |
osl_statement_get_nb_iterators function: this function returns the number of surroounding iterators of a given statement.
statement | The statement we want to know the number of iterators. |
Definition at line 755 of file statement.c.
References osl_statement::domain, osl_relation::nb_output_dims, and OSL_warning.
void osl_statement_idump | ( | FILE * | file, |
osl_statement_p | statement, | ||
int | level | ||
) |
osl_statement_idump function: this function displays an osl_statement_t structure (*statement) into a file (file, possibly stdout) in a way that trends to be understandable. It includes an indentation level (level) in order to work with others dumping functions.
[in] | file | File where the information has to be printed. |
[in] | statement | The statement whose information has to be printed. |
[in] | level | Number of spaces before printing, for each line. |
Definition at line 96 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_statement::next, osl_generic_idump(), osl_relation_idump(), osl_relation_list_idump(), and osl_statement::scattering.
Referenced by osl_dependence_idump(), osl_scop_idump(), and osl_statement_dump().
int osl_statement_integrity_check | ( | osl_statement_p | statement, |
int | expected_nb_parameters | ||
) |
osl_statement_integrity_check function: this function checks that a statement is "well formed" according to some expected properties (setting an expected value to OSL_UNDEFINED means that we do not expect a specific value). It returns 0 if the check failed or 1 if no problem has been detected.
[in] | statement | The statement we want to check. |
[in] | expected_nb_parameters | Expected number of parameters. |
Definition at line 693 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_body::iterators, osl_relation::nb_output_dims, osl_statement::next, osl_generic_lookup(), osl_relation_integrity_check(), osl_relation_list_integrity_check(), osl_strings_size(), OSL_TYPE_ACCESS, OSL_TYPE_DOMAIN, OSL_TYPE_SCATTERING, OSL_UNDEFINED, OSL_URI_BODY, OSL_warning, and osl_statement::scattering.
Referenced by osl_scop_integrity_check().
osl_statement_malloc function: this function allocates the memory space for an osl_statement_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.
Definition at line 508 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_statement::next, OSL_malloc, osl_statement::scattering, and osl_scop::statement.
Referenced by osl_statement_nclone(), and osl_statement_pread().
osl_statement_p osl_statement_nclone | ( | osl_statement_p | statement, |
int | n | ||
) |
osl_statement_nclone function: This function builds and returns a "hard copy" (not a pointer copy) of the n first elements of an osl_statement_t list.
statement | The pointer to the statement structure we want to clone. |
n | The number of nodes we want to copy (-1 for infinity). |
Definition at line 591 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_statement::next, osl_generic_clone(), osl_relation_clone(), osl_relation_list_clone(), osl_statement_malloc(), and osl_statement::scattering.
Referenced by osl_statement_clone().
int osl_statement_number | ( | osl_statement_p | statement | ) |
osl_statement_number function: this function returns the number of statements in the statement list provided as parameter.
[in] | statement | The first element of the statement list. |
Definition at line 572 of file statement.c.
References osl_statement::next.
Referenced by osl_scop_print(), and osl_scop_print_scoplib().
void osl_statement_pprint | ( | FILE * | file, |
osl_statement_p | statement, | ||
osl_names_p | names | ||
) |
osl_statement_pprint function: this function pretty-prints the content of an osl_statement_t structure (*statement) into a file (file, possibly stdout) in the OpenScop format.
[in] | file | The file where the information has to be printed. |
[in] | statement | The statement whose information has to be printed. |
[in] | names | The names of the constraint columns for comments. |
Definition at line 199 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_names::iterators, osl_body::iterators, osl_statement::next, osl_generic_lookup(), osl_generic_number(), osl_generic_print(), osl_names_free(), osl_relation_list_count(), osl_relation_list_pprint_elts(), osl_relation_pprint(), osl_statement_names(), OSL_URI_BODY, and osl_statement::scattering.
Referenced by osl_scop_print(), and osl_statement_print().
void osl_statement_pprint_scoplib | ( | FILE * | file, |
osl_statement_p | statement, | ||
osl_names_p | names | ||
) |
osl_statement_pprint_scoplib function: this function pretty-prints the content of an osl_statement_t structure (*statement) into a file (file, possibly stdout) in the SCoPLib format.
[in] | file | The file where the information has to be printed. |
[in] | statement | The statement whose information has to be printed. |
[in] | names | The names of the constraint columns for comments. |
Definition at line 288 of file statement.c.
References osl_statement::access, osl_statement::domain, osl_statement::extension, osl_names::iterators, osl_body::iterators, osl_relation::nb_rows, osl_statement::next, osl_body_print_scoplib(), osl_generic_lookup(), osl_names_free(), osl_relation_list_pprint_access_array_scoplib(), osl_relation_pprint_scoplib(), osl_statement_names(), OSL_URI_BODY, and osl_statement::scattering.
Referenced by osl_scop_print_scoplib().
osl_statement_p osl_statement_pread | ( | FILE * | file, |
osl_interface_p | registry, | ||
int | precision | ||
) |
osl_statement_pread function ("precision read"): this function reads an osl_statement_t structure from an input stream (possibly stdin).
[in] | file | The input stream. |
[in] | registry | The list of known interfaces (others are ignored). |
[in] | precision | The precision of the relation elements. |
Definition at line 452 of file statement.c.
References osl_statement::extension, osl_generic_add(), osl_generic_read_one(), osl_relation_list_pread(), osl_statement_dispatch(), osl_statement_malloc(), and osl_util_read_int().
Referenced by osl_scop_pread(), and osl_statement_read().
void osl_statement_print | ( | FILE * | file, |
osl_statement_p | statement | ||
) |
osl_statement_print function: this function prints the content of an osl_statement_t structure (*statement) into a file (file, possibly stdout) in the OpenScop format.
[in] | file | The file where the information has to be printed. |
[in] | statement | The statement whose information has to be printed. |
Definition at line 375 of file statement.c.
References osl_statement_pprint().
osl_statement_p osl_statement_read | ( | FILE * | foo | ) |
osl_statement_read function: this function is equivalent to osl_statement_pread() except that (1) the precision corresponds to the precision environment variable or to the highest available precision if it is not defined, and (2) the list of known interface is set to the default one.
Definition at line 486 of file statement.c.
References osl_interface_free(), osl_interface_get_default_registry(), osl_statement_pread(), osl_util_get_precision(), osl_scop::registry, and osl_scop::statement.