#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <scoplib/statement.h>
Functions | |
void | scoplib_statement_print_structure (FILE *file, scoplib_statement_p statement, int level) |
void | scoplib_statement_print (FILE *file, scoplib_statement_p statement) |
void | scoplib_statement_print_dot_scop (FILE *file, scoplib_statement_p statement, int nb_parameters, char **parameters, int nb_arrays, char **arrays) |
static char ** | scoplib_statement_read_strings (FILE *file, int nb_strings) |
static int | scoplib_statement_read_int (FILE *file) |
char ** | scoplib_scop_generate_names (char *, int) |
scoplib_statement_p | scoplib_statement_read (FILE *file, int nb_parameters, char ***arrays, int *nb_arr) |
scoplib_statement_p | scoplib_statement_malloc () |
void | scoplib_statement_free (scoplib_statement_p statement) |
void | scoplib_statement_shallow_free (scoplib_statement_p statement) |
void | scoplib_statement_add (scoplib_statement_p *location, scoplib_statement_p statement) |
int | scoplib_statement_number (scoplib_statement_p statement) |
char** scoplib_scop_generate_names | ( | char * | seed, | |
int | nb | |||
) |
scoplib_scop_generate_names function: This function generates an array of size 'nb' of chars of the form "seedXX" where XX goes from 1 to nb.
seed | The template for the created names | |
nb | The number of created items. |
Referenced by scoplib_scop_read(), and scoplib_statement_read().
void scoplib_statement_add | ( | scoplib_statement_p * | location, | |
scoplib_statement_p | statement | |||
) |
scoplib_statement_add function: This function adds a statement "statement" at the end of the statement list pointed by "location".
location | Address of the first element of the statement list. | |
statement | The statement to add to the list. |
void scoplib_statement_free | ( | scoplib_statement_p | statement | ) |
scoplib_statement_free function: This function frees the allocated memory for a scoplib_statement_t structure.
statement | The pointer to the statement we want to free. |
References scoplib_statement::body, scoplib_statement::control_predicates, scoplib_statement::domain, scoplib_statement::exit_predicates, scoplib_statement::iterators, scoplib_statement::nb_iterators, scoplib_statement::next, scoplib_statement::read, scoplib_statement::schedule, scoplib_matrix_free(), scoplib_matrix_list_free(), and scoplib_statement::write.
Referenced by scoplib_scop_free().
scoplib_statement_p scoplib_statement_malloc | ( | ) |
scoplib_statement_malloc function: This function allocates the memory space for a scoplib_statement_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.
References scoplib_statement::body, scoplib_statement::control_predicates, scoplib_statement::domain, scoplib_statement::exit_predicates, scoplib_statement::iterators, scoplib_statement::nb_control_predicates, scoplib_statement::nb_exit_predicates, scoplib_statement::nb_iterators, scoplib_statement::next, scoplib_statement::read, scoplib_statement::schedule, scoplib_scop::statement, and scoplib_statement::write.
Referenced by scoplib_scop_dup(), scoplib_scop_shallow_copy(), and scoplib_statement_read().
int scoplib_statement_number | ( | scoplib_statement_p | statement | ) |
scoplib_statement_number function: This function returns the number of statements in the statement list provided as parameter.
statement | The first element of the statement list. |
References scoplib_statement::next.
Referenced by scoplib_scop_print_dot_scop_().
void scoplib_statement_print | ( | FILE * | file, | |
scoplib_statement_p | statement | |||
) |
scoplib_statement_print function: This function prints the content of a scoplib_statement_t structure (*statement) into a file (file, possibly stdout).
file | File where informations are printed. | |
statement | The statement whose information have to be printed. |
References scoplib_statement_print_structure().
void scoplib_statement_print_dot_scop | ( | FILE * | file, | |
scoplib_statement_p | statement, | |||
int | nb_parameters, | |||
char ** | parameters, | |||
int | nb_arrays, | |||
char ** | arrays | |||
) |
scoplib_statement_print_dot_scop function: This function prints the content of a scoplib_statement_t structure (*statement) into a file (file, possibly stdout) for the .scop format.
file | File where informations are printed. | |
statement | The statement whose information have to be printed. | |
nb_parameters | The number of parameters in the SCoP. | |
parameters | An array containing all parameters names. | |
nb_arrays | The number of arrays accessed in the SCoP. | |
arrays | An array containing all accessed array names. |
References scoplib_statement::body, scoplib_statement::domain, scoplib_statement::iterators, scoplib_statement::nb_iterators, scoplib_statement::next, scoplib_statement::read, scoplib_statement::schedule, scoplib_matrix_list_print_dot_scop(), scoplib_matrix_print_dot_scop(), SCOPLIB_TYPE_ACCESS, SCOPLIB_TYPE_DOMAIN, SCOPLIB_TYPE_SCATTERING, and scoplib_statement::write.
Referenced by scoplib_scop_print_dot_scop_().
void scoplib_statement_print_structure | ( | FILE * | file, | |
scoplib_statement_p | statement, | |||
int | level | |||
) |
scoplib_statement_print_structure function: Displays a scoplib_statement_t structure (*statement) 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 print_structure functions.
file | File where informations are printed. | |
statement | The statement whose information have to be printed. | |
level | Number of spaces before printing, for each line. |
: do it!
References scoplib_statement::body, scoplib_statement::domain, scoplib_statement::iterators, scoplib_statement::nb_iterators, scoplib_statement::next, scoplib_statement::read, scoplib_statement::schedule, scoplib_matrix_list_print_structure(), scoplib_matrix_print_structure(), and scoplib_statement::write.
Referenced by scoplib_scop_print_structure(), and scoplib_statement_print().
scoplib_statement_p scoplib_statement_read | ( | FILE * | file, | |
int | nb_parameters, | |||
char *** | arrays, | |||
int * | nb_arr | |||
) |
scoplib_statement_read function: This function reads a scoplib_statement_t structure from an input stream (possibly stdin).
file | The input stream | |
nb_parameters | The number of global parameters for the program | |
arrays | The array containing names of arrays of the input program | |
nb_arr | The size of the array parameter |
References scoplib_statement::body, scoplib_statement::domain, scoplib_matrix_list::elt, scoplib_statement::iterators, scoplib_statement::nb_iterators, scoplib_matrix::NbColumns, scoplib_statement::read, scoplib_statement::schedule, scoplib_matrix_list_read(), scoplib_matrix_read(), scoplib_matrix_read_arrays(), scoplib_scop_generate_names(), scoplib_statement_malloc(), scoplib_statement_read_int(), scoplib_statement_read_strings(), and scoplib_statement::write.
Referenced by scoplib_scop_read().
static int scoplib_statement_read_int | ( | FILE * | file | ) | [static] |
Internal function. Read an int on the input 'file'.
should be placed somewhere else, it's duplicated in scop.c.
References SCOPLIB_MAX_STRING.
Referenced by scoplib_statement_read().
static char** scoplib_statement_read_strings | ( | FILE * | file, | |
int | nb_strings | |||
) | [static] |
Internal function. Read 'nb_strings' strings on the input 'file'.
should be placed somewhere else, it's duplicated in scop.c.
References SCOPLIB_MAX_STRING.
Referenced by scoplib_statement_read().
void scoplib_statement_shallow_free | ( | scoplib_statement_p | statement | ) |
scoplib_statement_shallow_free function:
This function frees the allocated memory for a scoplib_statement_t structure, without touching the content of the iterators array and body field.
statement | The pointer to the statement we want to free. |
References scoplib_statement::control_predicates, scoplib_statement::domain, scoplib_statement::exit_predicates, scoplib_statement::iterators, scoplib_statement::next, scoplib_statement::read, scoplib_statement::schedule, scoplib_matrix_free(), scoplib_matrix_list_free(), and scoplib_statement::write.
Referenced by scoplib_scop_shallow_free().