2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: august 1st 2002 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2001-2005 Cedric Bastoul *
17 * This is free software; you can redistribute it and/or modify it under the *
18 * terms of the GNU General Public License as published by the Free Software *
19 * Foundation; either version 2 of the License, or (at your option) any later *
22 * This software is distributed in the hope that it will be useful, but *
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
27 * You should have received a copy of the GNU General Public License along *
28 * with software; if not, write to the Free Software Foundation, Inc., *
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
31 * CLooG, the Chunky Loop Generator *
32 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 ******************************************************************************/
39 #if defined(__cplusplus)
46 # define FIRST_PARAMETER 'M'
47 # define FIRST_ITERATOR 'i'
51 * CloogNames structure:
52 * this structure contains all the informations about parameter and iterator
56 { int _nb_scalars
; /**< Scalar dimension number. */
57 int _nb_scattering
; /**< Scattering iterator number. */
58 int _nb_iterators
; /**< Iterator number. */
59 int _nb_parameters
; /**< Parameter number. */
60 char ** _scalars
; /**< The scalar names (an array of strings). */
61 char ** _scattering
; /**< The scattering names (an array of strings). */
62 char ** _iterators
; /**< The iterator names (an array of strings). */
63 char ** _parameters
; /**< The parameter names (an array of strings). */
64 int _references
; /**< Number of references to this structure. */
66 typedef struct cloognames CloogNames
;
69 static inline int cloog_names_nb_scalars (CloogNames
*n
)
71 return n
->_nb_scalars
;
74 static inline void cloog_names_set_nb_scalars (CloogNames
*n
, int nb
)
79 static inline int cloog_names_nb_scattering (CloogNames
*n
)
81 return n
->_nb_scattering
;
84 static inline void cloog_names_set_nb_scattering (CloogNames
*n
, int nb
)
86 n
->_nb_scattering
= nb
;
89 static inline int cloog_names_nb_iterators (CloogNames
*n
)
91 return n
->_nb_iterators
;
94 static inline void cloog_names_set_nb_iterators (CloogNames
*n
, int nb
)
96 n
->_nb_iterators
= nb
;
99 static inline int cloog_names_nb_parameters (CloogNames
*n
)
101 return n
->_nb_parameters
;
104 static inline void cloog_names_set_nb_parameters (CloogNames
*n
, int nb
)
106 n
->_nb_parameters
= nb
;
109 static inline char **cloog_names_scalars (CloogNames
*n
)
114 static inline void cloog_names_set_scalars (CloogNames
*n
, char **s
)
119 static inline char *cloog_names_scalar_elt (CloogNames
*n
, int i
)
121 return n
->_scalars
[i
];
124 static inline void cloog_names_set_scalar_elt (CloogNames
*n
, int i
, char *s
)
129 static inline char **cloog_names_scattering (CloogNames
*n
)
131 return n
->_scattering
;
134 static inline void cloog_names_set_scattering (CloogNames
*n
, char **s
)
139 static inline char *cloog_names_scattering_elt (CloogNames
*n
, int i
)
141 return n
->_scattering
[i
];
144 static inline void cloog_names_set_scattering_elt (CloogNames
*n
, int i
, char *s
)
146 n
->_scattering
[i
] = s
;
149 static inline char **cloog_names_iterators (CloogNames
*n
)
151 return n
->_iterators
;
154 static inline void cloog_names_set_iterators (CloogNames
*n
, char **s
)
159 static inline char *cloog_names_iterator_elt (CloogNames
*n
, int i
)
161 return n
->_iterators
[i
];
164 static inline void cloog_names_set_iterator_elt (CloogNames
*n
, int i
, char *s
)
166 n
->_iterators
[i
] = s
;
169 static inline char **cloog_names_parameters (CloogNames
*n
)
171 return n
->_parameters
;
174 static inline void cloog_names_set_parameters (CloogNames
*n
, char **s
)
179 static inline char *cloog_names_parameter_elt (CloogNames
*n
, int i
)
181 return n
->_parameters
[i
];
184 static inline void cloog_names_set_parameter_elt (CloogNames
*n
, int i
, char *s
)
186 n
->_parameters
[i
] = s
;
190 /******************************************************************************
191 * Structure display function *
192 ******************************************************************************/
193 void cloog_names_print_structure(FILE *, CloogNames
*, int) ;
194 void cloog_names_print(FILE *, CloogNames
*) ;
197 /******************************************************************************
198 * Memory deallocation function *
199 ******************************************************************************/
200 void cloog_names_free(CloogNames
*) ;
203 /******************************************************************************
204 * Reading functions *
205 ******************************************************************************/
206 char ** cloog_names_read_strings(FILE *, int, char *, char) ;
209 /******************************************************************************
210 * Processing functions *
211 ******************************************************************************/
212 CloogNames
* cloog_names_malloc(void);
213 CloogNames
* cloog_names_copy(CloogNames
*names
);
214 CloogNames
* cloog_names_alloc(int,int,int,int,char **,char **,char **,char **);
215 char ** cloog_names_generate_items(int, char *, char) ;
216 CloogNames
* cloog_names_generate(int, int, int, int, char, char, char, char) ;
217 void cloog_names_scalarize(CloogNames
*, int, int *) ;
219 #if defined(__cplusplus)
222 #endif /* define _H */