PIPS
hpfc.c
Go to the documentation of this file.
1 /*
2 
3  $Id: hpfc.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  * functions to test hpfc-related special entities. needed by syntax.
29  * moved here from hpfc to break a cyclic dependence hpfc -> syntax.
30  * done on 22/09/95 by FC. Hpfc and sytax *must* be independent.
31  * However I am not so happy about putting hpfc code here,
32  * outside of home:-)
33  */
34 
35 #include <stdio.h>
36 #include <string.h>
37 
38 #include "linear.h"
39 
40 #include "genC.h"
41 #include "ri.h"
42 
43 #include "misc.h"
44 #include "properties.h"
45 #include "ri-util.h"
46 
47 /* recognize an hpf directive special entity.
48  * (the prefix of which is HPF_PREFIX, as a convention)
49  * both functions are available, based on the name and on the entity.
50  */
51 bool hpf_directive_string_p(const char* s)
52 {
53  return strncmp(HPF_PREFIX, s, strlen(HPF_PREFIX))==0;
54 }
55 
57 {
58  return top_level_entity_p(e) &&
60 }
61 
63 {
64  return top_level_entity_p(f) &&
66 }
67 
69 {
70  return top_level_entity_p(f) &&
72 }
73 
75 {
76  return top_level_entity_p(f) &&
78 }
79 
80 bool fcd_directive_string_p(const char* s)
81 {
88 }
89 
91 {
92  return top_level_entity_p(f) &&
94 }
95 
96 /* whether an entity must be kept in the code.
97  * if so, a maybe fake source code must be supplied,
98  * and the directive will be kept in the callee list.
99  * not kept if some property tells not to...
100  */
101 bool keep_directive_in_code_p(const char* s)
102 {
103  return fcd_directive_string_p(s) &&
105  get_bool_property(FCD_IGNORE_PREFIX "SYNCHRO")) &&
110  /* !(same_string_p(s, HPF_PREFIX TELL_SUFFIX) &&
111  get_bool_property(FCD_IGNORE_PREFIX "TELL")) */
112 }
113 
114 /* that is all
115  */
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define same_string_p(s1, s2)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
#define DEAD_SUFFIX
#define HPF_PREFIX
moved here because needed by syntax:-(
#define TIMEON_SUFFIX
#define SYNCHRO_SUFFIX
#define FCD_IGNORE_PREFIX
property prefix for ignoring FCD directives TIME, SYNCHRO and SET exists.
#define REALIGN_SUFFIX
#define REDISTRIBUTE_SUFFIX
#define HOSTSECTION_SUFFIX
#define TIMEOFF_SUFFIX
#define TELL_SUFFIX
suffixes for my own (FCD:-) directives.
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
Definition: entity.c:1130
bool hpf_directive_string_p(const char *s)
recognize an hpf directive special entity.
Definition: hpfc.c:51
bool fcd_directive_string_p(const char *s)
Definition: hpfc.c:80
bool fcd_directive_p(entity f)
Definition: hpfc.c:90
bool realign_directive_p(entity f)
Definition: hpfc.c:62
bool dead_fcd_directive_p(entity f)
Definition: hpfc.c:74
bool redistribute_directive_p(entity f)
Definition: hpfc.c:68
bool hpf_directive_entity_p(entity e)
Definition: hpfc.c:56
bool keep_directive_in_code_p(const char *s)
whether an entity must be kept in the code.
Definition: hpfc.c:101