statement.h File Reference

#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 dependency graph for statement.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osl_statement

Typedefs

typedef struct osl_statement osl_statement_t
typedef struct osl_statementosl_statement_p

Functions

void osl_statement_idump (FILE *, osl_statement_p, int)
void osl_statement_dump (FILE *, osl_statement_p)
void osl_statement_pprint (FILE *, osl_statement_p, osl_names_p)
void osl_statement_print (FILE *, osl_statement_p)
osl_statement_p osl_statement_pread (FILE *, osl_interface_p, int)
osl_statement_p osl_statement_read (FILE *)
osl_statement_p osl_statement_malloc ()
void osl_statement_free (osl_statement_p)
void osl_statement_add (osl_statement_p *, osl_statement_p)
void osl_statement_compact (osl_statement_p, int)
int osl_statement_number (osl_statement_p)
osl_statement_p osl_statement_clone (osl_statement_p)
int osl_statement_equal (osl_statement_p, osl_statement_p)
int osl_statement_integrity_check (osl_statement_p, int)
int osl_statement_get_nb_iterators (osl_statement_p)
void osl_statement_get_attributes (osl_statement_p, int *, int *, int *, int *, int *)

Typedef Documentation

typedef struct osl_statement* osl_statement_p

Definition at line 96 of file statement.h.

Definition at line 95 of file statement.h.


Function Documentation

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".

Parameters:
[in,out] location Address of the first element of the statement list.
[in] statement The statement to add to the list.

Definition at line 464 of file statement.c.

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.

Parameters:
[in] statement The pointer to the statement we want to clone.
Returns:
A pointer to the clone of the statement provided as parameter.

Definition at line 498 of file statement.c.

References osl_statement::access, osl_statement::body, osl_statement::domain, osl_statement::next, osl_generic_clone(), osl_relation_clone(), osl_relation_list_clone(), osl_statement_malloc(), and osl_statement::scattering.

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).

Parameters:
[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).

Parameters:
[in] s1 The first statement.
[in] s2 The second statement.
Returns:
1 if s1 and s2 are the same (content-wise), 0 otherwise.

Definition at line 535 of file statement.c.

References osl_statement::access, osl_statement::body, osl_statement::domain, 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.

Parameters:
[in,out] statement The pointer to the statement we want to free.

Definition at line 436 of file statement.c.

References osl_statement::access, osl_statement::body, osl_statement::domain, 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.

Parameters:
[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 679 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().

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.

Parameters:
statement The statement we want to know the number of iterators.
Returns:
The number of surrounding iterators for the statement.

Definition at line 649 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.

Parameters:
[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::body, osl_statement::domain, osl_statement::next, osl_generic_idump(), osl_relation_idump(), osl_relation_list_idump(), and osl_statement::scattering.

Referenced by 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.

Parameters:
[in] statement The statement we want to check.
[in] expected_nb_parameters Expected number of parameters.
Returns:
0 if the integrity check fails, 1 otherwise.

Definition at line 587 of file statement.c.

References osl_statement::access, osl_statement::body, osl_generic::data, osl_statement::domain, osl_relation::nb_output_dims, osl_statement::next, osl_generic_has_URI(), 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_p osl_statement_malloc (  ) 

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.

Returns:
A pointer to an empty statement with fields set to default values.

Definition at line 416 of file statement.c.

References osl_statement::access, osl_statement::body, osl_statement::domain, osl_statement::next, OSL_malloc, osl_statement::scattering, and osl_scop::statement.

Referenced by osl_statement_clone(), and osl_statement_pread().

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.

Parameters:
[in] statement The first element of the statement list.
Returns:
The number of statements in the statement list.

Definition at line 480 of file statement.c.

References osl_statement::next.

Referenced by osl_scop_print().

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.

Parameters:
[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::body, osl_generic::data, osl_statement::domain, osl_names::iterators, osl_statement::next, osl_generic_has_URI(), 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().

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).

Parameters:
[in] file The input stream.
[in] registry The list of known interfaces (others are ignored).
[in] precision The precision of the relation elements.
Returns:
A pointer to the statement structure that has been read.

Definition at line 365 of file statement.c.

References osl_statement::body, 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.

Parameters:
[in] file The file where the information has to be printed.
[in] statement The statement whose information has to be printed.

Definition at line 288 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.

See also:
{osl_statement_pread}

Definition at line 394 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.

Generated on Fri Feb 17 15:26:47 2012 for OpenScop by  doxygen 1.6.3