PIPS
effects-generic-local.h
Go to the documentation of this file.
1
/*
2
3
$Id: effects-generic-local.h 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
#include "
effects.h
"
25
26
27
28
/* some string constants for prettyprints...
29
*/
30
#define ACTION_UNDEFINED string_undefined
31
#define ACTION_READ "R"
32
#define ACTION_WRITE "W"
33
#define ACTION_IN "IN"
34
#define ACTION_OUT "OUT"
35
#define ACTION_COPYIN "COPYIN"
36
#define ACTION_COPYOUT "COPYOUT"
37
#define ACTION_PRIVATE "PRIVATE"
38
#define ACTION_LIVE_IN "ALIVE (IN)"
39
#define ACTION_LIVE_OUT "ALIVE (OUT)"
40
41
/* for debug
42
*/
43
// functions that can be pointed by effect_consistent_p_func:
44
// effect_consistent_p
45
// region_consistent_p
46
#define pips_debug_effect(level, message, eff) \
47
ifdebug(level) { pips_debug(level, "%s\n"
, message); \
48
(*effect_consistent_p_func)(eff); \
49
(*effect_prettyprint_func)(eff);}
50
51
#define pips_debug_effects(level, message, l_eff) \
52
ifdebug(level) { pips_debug(level, "%s\n"
, message); \
53
generic_print_effects(l_eff);}
54
55
/* prettyprint function types:
56
*/
57
#include "
text.h
"
/* hum... */
58
typedef
text
(*
generic_text_function
)(
list
/* of effect */
);
59
typedef
void (*
generic_prettyprint_function
)(
list
/* of effect */
);
60
typedef
void (*
generic_attachment_function
)(
text
);
61
62
/* for db_* functions
63
*/
64
#define DB_GET_SE(name, NAME) \
65
static statement_effects db_get_##name(const char *module_name) \
66
{ \
67
return (statement_effects) \
68
db_get_memory_resource(DBR_##NAME, module_name, true); \
69
}
70
71
#define DB_GET_LS(name, NAME) \
72
static list db_get_##name(const char *module_name) \
73
{ \
74
return effects_to_list( \
75
(effects) db_get_memory_resource(DBR_##NAME, module_name, true)); \
76
}
77
78
#define DB_GET_EE(name, NAME) \
79
static entity_effects db_get_##name(const char *module_name) \
80
{ \
81
return (entity_effects) \
82
db_get_memory_resource(DBR_##NAME, module_name, true); \
83
}
84
85
#define DB_PUT_SE(name, NAME) \
86
static void db_put_##name( \
87
const char *module_name, statement_effects se) \
88
{ \
89
DB_PUT_MEMORY_RESOURCE(DBR_##NAME, module_name, (void*) se); \
90
}
91
92
#define DB_PUT_LS(name, NAME) \
93
static void db_put_##name(const char *module_name, list l) \
94
{ \
95
DB_PUT_MEMORY_RESOURCE(DBR_##NAME, module_name, \
96
(void*) list_to_effects(l)); \
97
}
98
99
#define DB_PUT_EE(name, NAME) \
100
static void db_put_##name( \
101
const char *module_name, entity_effects ee) \
102
{ \
103
DB_PUT_MEMORY_RESOURCE(DBR_##NAME, module_name, (void*) ee); \
104
}
105
106
#define DB_NOPUT_SE(name) \
107
static void db_put_##name(_UNUSED_ const char *m, statement_effects se) \
108
{ \
109
free_statement_effects(se); \
110
}
111
112
#define DB_NOPUT_LS(name) \
113
static void db_put_##name(_UNUSED_ const char *m, list l) \
114
{ \
115
gen_full_free_list(l); \
116
}
117
118
#define DB_NOPUT_EE(name) \
119
static void db_put_##name(_UNUSED_ const char *m, entity_effects ee) \
120
{ \
121
free_entity_effects(se); \
122
}
123
124
#define DB_GETPUT_SE(name, NAME) DB_GET_SE(name, NAME) DB_PUT_SE(name, NAME)
125
#define DB_GETNOPUT_SE(name, NAME) DB_GET_SE(name, NAME) DB_NOPUT_SE(name)
126
#define DB_GETPUT_LS(name, NAME) DB_GET_LS(name, NAME) DB_PUT_LS(name, NAME)
127
#define DB_GETNOPUT_LS(name, NAME) DB_GET_LS(name, NAME) DB_NOPUT_LS(name)
128
#define DB_GETPUT_EE(name, NAME) DB_GET_EE(name, NAME) DB_PUT_EE(name, NAME)
129
#define DB_GETNOPUT_EE(name, NAME) DB_GET_EE(name, NAME) DB_NOPUT_EE(name)
130
131
typedef
enum
{
with_no_pointer_info
,
with_points_to
,
with_pointer_values
}
132
pointer_info_val
;
133
134
typedef
enum
{
simple
,
convex
}
effects_representation_val
;
135
136
/* end of effects-generic-local.h
137
*/
generic_prettyprint_function
void(* generic_prettyprint_function)(list)
Definition:
effects-generic-local.h:59
pointer_info_val
pointer_info_val
Definition:
effects-generic-local.h:131
with_points_to
@ with_points_to
Definition:
effects-generic-local.h:131
with_no_pointer_info
@ with_no_pointer_info
Definition:
effects-generic-local.h:131
with_pointer_values
@ with_pointer_values
Definition:
effects-generic-local.h:131
generic_text_function
text(* generic_text_function)(list)
prettyprint function types:
Definition:
effects-generic-local.h:58
generic_attachment_function
void(* generic_attachment_function)(text)
Definition:
effects-generic-local.h:60
effects_representation_val
effects_representation_val
Definition:
effects-generic-local.h:134
convex
@ convex
Definition:
effects-generic-local.h:134
simple
@ simple
Definition:
effects-generic-local.h:134
effects.h
cons
The structure used to build lists in NewGen.
Definition:
newgen_list.h:41
text.h
text
struct _newgen_struct_text_ * text
Definition:
text.h:23
pips
src
Libs
effects-generic
effects-generic-local.h
Generated on Thu Sep 26 2024 22:11:36 for PIPS by
1.9.1