PIPS
parameter.c
Go to the documentation of this file.
1 /*
2 
3  $Id: parameter.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 
28 #include <stdio.h>
29 #include <string.h>
30 
31 #include "genC.h"
32 #include "linear.h"
33 #include "ri.h"
34 #include "ri-util.h"
35 #include "prettyprint.h"
36 
37 /*
38  * Functions for effective parameters
39  */
40 
41 /**
42  * Display a parameter on stderr, useful for debugging
43  * @param p is the parameter to display
44  */
46  if(p == parameter_undefined) {
47  fprintf(stderr, "PARAMETER UNDEFINED\n");
48  } else {
49  fprintf(stderr, "type = ");
51  fprintf(stderr, "\nmode= ");
53  fprintf(stderr, "\ndummy= ");
55  fprintf(stderr, "\n");
56  }
57 }
58 
59 /**
60  * Display a parameter on stderr, useful for debugging
61  * @param lp is the list of parameters to display
62  */
64  FOREACH(PARAMETER, p , lp)
65  {
66  print_parameter(p);
67  }
68 }
69 
70 
71 
72 /**
73  * Display a "mode" on stderr, useful for debugging
74  * @param p is the mode to display
75  */
76 void print_mode(mode m) {
77  if(!mode_defined_p(m)) {
78  fprintf(stderr, "MODE UNDEFINED\n");
79  } else if( mode_value_p(m)) {
80  fprintf(stderr, "value");
81  } else if( mode_reference_p(m)) {
82  fprintf(stderr, "reference");
83  } else {
84  fprintf(stderr, "unknown");
85  }
86 }
87 
88 
89 /**
90  * Display a "dummy" on stderr, useful for debugging
91  * @param d is the dummy to display
92  */
93 void print_dummy(dummy d) {
94  if(!dummy_defined_p(d)) {
95  fprintf(stderr, "DUMMY UNDEFINED\n");
96  } else {
97  fprintf(stderr, "%s",entity_name(dummy_identifier(d)));
98  }
99 }
bool mode_defined_p(mode p)
Definition: ri.c:1320
bool dummy_defined_p(dummy p)
Definition: ri.c:584
int dummy
A dummy file, to prevent empty libraries from breaking builds.
Definition: dummy.c:41
#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 print_parameters(list lp)
Display a parameter on stderr, useful for debugging.
Definition: parameter.c:63
void print_parameter(parameter p)
Display a parameter on stderr, useful for debugging.
Definition: parameter.c:45
void print_mode(mode m)
Display a "mode" on stderr, useful for debugging.
Definition: parameter.c:76
void print_dummy(dummy d)
Display a "dummy" on stderr, useful for debugging.
Definition: parameter.c:93
void print_type(type)
For debugging.
Definition: type.c:111
#define dummy_identifier(x)
Definition: ri.h:1033
#define parameter_dummy(x)
Definition: ri.h:1823
#define parameter_type(x)
Definition: ri.h:1819
#define parameter_undefined
Definition: ri.h:1794
#define parameter_mode(x)
Definition: ri.h:1821
#define mode_value_p(x)
Definition: ri.h:1694
#define entity_name(x)
Definition: ri.h:2790
#define PARAMETER(x)
PARAMETER.
Definition: ri.h:1788
#define mode_reference_p(x)
Definition: ri.h:1697
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