PIPS
loop.c
Go to the documentation of this file.
1 /*
2 
3  $Id: loop.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 #include <stdio.h>
28 
29 #include "linear.h"
30 #include "genC.h"
31 
32 #include "misc.h"
33 #include "properties.h"
34 
35 #include "ri.h"
36 #include "ri-util.h"
37 #include "text-util.h"
38 #include "prettyprint.h"
39 
40 /*========================================================================*/
41 /* void fprint_loop(fp, lp): print a loop.
42  *
43  * AC 94/06/07
44  */
45 
46 /* copied from reindexing/reindexing_utils.c for debugging */
47 
48 void printf_loop(loop lp) {
49  FILE *fp = stdout;
50 
51  fprintf(fp,"\nLoop index information:");
53 
54  fprintf(fp,"\nDomaine (lower, upper, inc):");
57  fprintf(fp,", ");
60  fprintf(fp,", ");
63 
64  fprintf(fp,"\nLabel:");
66 
67  fprintf(fp,"\nExecution Type");
69  fprintf(fp, " ->sequentiel");
70  else
71  fprintf(fp, " ->parallele");
72 
73  fprintf(fp, "\nLocals: ");
75 
76  fprintf(fp,"\n");
77 }
78 
80 {
81  FOREACH(LOOP, l, sl) {
82  list pdl = NIL;
83  text t = text_loop(mod, entity_name(loop_label(l)), 2, l, 0, &pdl, true);
84  gen_free_list(pdl);
85  print_text(stderr,t);
86  }
87 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
void fprint_entity_list(FILE *fp, list l)
void fprint_entity_list(FILE *fp,list l): prints a list of entities on file fp.
Definition: entity.c:3188
void fprint_list_of_exp(FILE *fp, list exp_l)
void fprint_list_of_exp(FILE *fp, list exp_l): prints in the file "fp" the list of expression "exp_l"...
Definition: expression.c:229
void print_loops_list(entity mod, list sl)
Definition: loop.c:79
void printf_loop(loop lp)
=======================================================================
Definition: loop.c:48
text text_loop(entity module, const char *label, int margin, loop obj, int n, list *ppdl, bool is_recursive_p)
exported for conversion/look_for_nested_loops.c
Definition: misc.c:3264
#define LOOP(x)
LOOP.
Definition: ri.h:1606
#define loop_execution(x)
Definition: ri.h:1648
#define range_upper(x)
Definition: ri.h:2290
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define range_increment(x)
Definition: ri.h:2292
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define execution_sequential_p(x)
Definition: ri.h:1208
#define entity_name(x)
Definition: ri.h:2790
#define loop_label(x)
Definition: ri.h:1646
#define loop_locals(x)
Definition: ri.h:1650
#define range_lower(x)
Definition: ri.h:2288
#define loop_range(x)
Definition: ri.h:1642
#define loop_index(x)
Definition: ri.h:1640
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
void print_text(FILE *fd, text t)
Definition: print.c:195