OpenScop
0.9.0
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <osl/macros.h>
#include <osl/util.h>
#include <osl/strings.h>
#include <osl/interface.h>
#include <osl/extensions/loop.h>
Go to the source code of this file.
Functions | |
void | osl_loop_idump (FILE *file, osl_loop_p loop, int level) |
void | osl_loop_dump (FILE *file, osl_loop_p loop) |
char * | osl_loop_sprint (osl_loop_p loop) |
osl_loop_p | osl_loop_sread (char **input) |
osl_loop_p | osl_loop_malloc () |
void | osl_loop_free (osl_loop_p loop) |
osl_loop_p | osl_loop_clone_one (osl_loop_p loop) |
osl_loop_p | osl_loop_clone (osl_loop_p loop) |
int | osl_loop_equal_one (osl_loop_p a1, osl_loop_p a2) |
int | osl_loop_equal (osl_loop_p a1, osl_loop_p a2) |
osl_interface_p | osl_loop_interface () |
void | osl_loop_add (osl_loop_p loop, osl_loop_p *ll) |
int | osl_loop_count (osl_loop_p ll) |
void osl_loop_add | ( | osl_loop_p | loop, |
osl_loop_p * | ll | ||
) |
osl_loop_add function: this function adds a loop structure at the end of the list
[in,out] | ll | Pointer to a list of loops. |
[in] | loop | Pointer to the loop structure to be added. |
Definition at line 570 of file loop.c.
References osl_loop::next.
osl_loop_p osl_loop_clone | ( | osl_loop_p | loop | ) |
osl_loop_clone function: this function builds and returns a "hard copy" (not a pointer copy) of a list of osl_loop_t data structures.
[in] | loop | The pointer to the list of loop structure to clone. |
Definition at line 402 of file loop.c.
References osl_loop::next, and osl_loop_clone_one().
Referenced by osl_loop_interface().
osl_loop_p osl_loop_clone_one | ( | osl_loop_p | loop | ) |
osl_loop_clone_one function: this function builds and returns a "hard copy" (not a pointer copy) of "one" (and not the whole list) osl_loop_t data structure.
[in] | loop | The pointer to the loop structure to clone. |
Definition at line 370 of file loop.c.
References osl_loop::directive, osl_loop::iter, osl_loop::nb_stmts, osl_loop_malloc(), OSL_malloc, OSL_strdup, osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_clone().
int osl_loop_count | ( | osl_loop_p | ll | ) |
osl_loop_count: this function returns the number of elements in the list
[in] | ll | Pointer to a list of loops. |
Definition at line 586 of file loop.c.
References osl_loop::next.
Referenced by osl_loop_equal(), and osl_loop_sprint().
void osl_loop_dump | ( | FILE * | file, |
osl_loop_p | loop | ||
) |
osl_loop_dump function: this function prints the content of an osl_loop_t structure (*loop) into a file (file, possibly stdout).
[in] | file | The file where the information has to be printed. |
[in] | loop | The loop structure to print. |
Definition at line 174 of file loop.c.
References osl_loop_idump().
int osl_loop_equal | ( | osl_loop_p | a1, |
osl_loop_p | a2 | ||
) |
osl_loop_equal function: this function returns true if the two loop lists are the same (content-wise), false otherwise. Two lists are equal if one contains all the elements of the other and vice versa. The exact order of the nodes is not taken into account by this function.
[in] | a1 | The first loop list. |
[in] | a2 | The second loop list. |
Definition at line 501 of file loop.c.
References osl_loop::next, OSL_info, osl_loop_count(), and osl_loop_equal_one().
Referenced by osl_loop_interface().
int osl_loop_equal_one | ( | osl_loop_p | a1, |
osl_loop_p | a2 | ||
) |
osl_loop_equal_one function: this function returns true if the two loop structures are the same (content-wise), false otherwise. This functions considers two loop structures as equal if the order of the array names differ, however the identifiers and names must be the same.
[in] | a1 | The first loop structure. |
[in] | a2 | The second loop structure. |
Definition at line 436 of file loop.c.
References osl_loop::directive, osl_loop::iter, osl_loop::nb_stmts, osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_equal().
void osl_loop_free | ( | osl_loop_p | loop | ) |
osl_loop_free function: this function frees the allocated memory for an loop structure.
[in,out] | loop | The pointer to the loop structure we want to free. |
Definition at line 341 of file loop.c.
References osl_loop::iter, osl_loop::next, osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_interface().
void osl_loop_idump | ( | FILE * | file, |
osl_loop_p | loop, | ||
int | level | ||
) |
osl_loop_idump function: this function displays an osl_loop_t structure (loop) 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 idump functions.
[in] | file | The file where the information has to be printed. |
[in] | loop | The loop structure to print. |
[in] | level | Number of spaces before printing, for each line. |
Definition at line 91 of file loop.c.
References osl_loop::directive, osl_loop::iter, osl_loop::nb_stmts, osl_loop::next, osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_dump(), and osl_loop_interface().
osl_loop_interface function: this function creates an interface structure corresponding to the loop extension and returns it.
Definition at line 547 of file loop.c.
References osl_interface_malloc(), osl_loop_clone(), osl_loop_equal(), osl_loop_free(), osl_loop_idump(), osl_loop_malloc(), osl_loop_sprint(), osl_loop_sread(), OSL_strdup, and OSL_URI_LOOP.
Referenced by osl_interface_get_default_registry().
osl_loop_malloc function: this function allocates the memory space for an osl_loop_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.
Definition at line 320 of file loop.c.
References osl_loop::directive, osl_loop::iter, osl_loop::nb_stmts, osl_loop::next, OSL_malloc, osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_clone_one(), osl_loop_interface(), and osl_loop_sread().
char* osl_loop_sprint | ( | osl_loop_p | loop | ) |
osl_loop_sprint function: this function prints the content of an osl_loop_t structure (*loop) into a string (returned) in the OpenScop textual format.
[in] | loop | The loop structure to print. |
Definition at line 186 of file loop.c.
References osl_loop::directive, osl_loop::iter, osl_loop::nb_stmts, osl_loop::next, osl_loop_count(), OSL_malloc, OSL_MAX_STRING, OSL_realloc, osl_util_safe_strcat(), osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_interface().
osl_loop_p osl_loop_sread | ( | char ** | input | ) |
osl_loop_sread function: this function reads a loop structure from a string complying to the OpenScop textual format and returns a pointer to this loop structure. The input parameter is updated to the position in the input string this function reaches right after reading the comment structure.
[in,out] | input | The input string where to find an loop structure. Updated to the position after what has been read. |
Definition at line 259 of file loop.c.
References osl_loop::directive, osl_loop::iter, osl_loop::nb_stmts, osl_loop::next, OSL_debug, osl_loop_malloc(), OSL_malloc, osl_util_read_int(), osl_util_read_line(), osl_util_read_string(), osl_loop::private_vars, and osl_loop::stmt_ids.
Referenced by osl_loop_interface().