@@ -83,40 +83,66 @@ class dep_graph_domaint:public ai_domain_baset
83
83
goto_programt::const_targett from,
84
84
goto_programt::const_targett to,
85
85
ai_baset &ai,
86
- const namespacet &ns) final ;
86
+ const namespacet &ns) final override ;
87
87
88
88
void output (
89
89
std::ostream &out,
90
90
const ai_baset &ai,
91
- const namespacet &ns) const final ;
91
+ const namespacet &ns) const final override ;
92
92
93
93
jsont output_json (
94
94
const ai_baset &ai,
95
95
const namespacet &ns) const override ;
96
96
97
97
void make_top () final override
98
98
{
99
- assert (node_id!=std::numeric_limits<node_indext>::max ());
99
+ DATA_INVARIANT (node_id!=std::numeric_limits<node_indext>::max (),
100
+ " node_id must not be valid" );
100
101
101
102
has_values=tvt (true );
102
103
control_deps.clear ();
103
104
data_deps.clear ();
104
105
}
105
106
106
- void make_bottom () final
107
+ void make_bottom () final override
107
108
{
108
- assert (node_id!=std::numeric_limits<node_indext>::max ());
109
+ DATA_INVARIANT (node_id!=std::numeric_limits<node_indext>::max (),
110
+ " node_id must be valid" );
109
111
110
112
has_values=tvt (false );
111
113
control_deps.clear ();
112
114
data_deps.clear ();
113
115
}
114
116
115
- void make_entry () final
117
+ void make_entry () final override
116
118
{
117
119
make_top ();
118
120
}
119
121
122
+ bool is_top () const final override
123
+ {
124
+ DATA_INVARIANT (node_id!=std::numeric_limits<node_indext>::max (),
125
+ " node_id must be valid" );
126
+
127
+ DATA_INVARIANT (!has_values.is_true () ||
128
+ (control_deps.empty () && data_deps.empty ()),
129
+ " If the domain is top, it must have no dependencies" );
130
+
131
+ return has_values.is_true ();
132
+ }
133
+
134
+ bool is_bottom () const final override
135
+ {
136
+ DATA_INVARIANT (node_id!=std::numeric_limits<node_indext>::max (),
137
+ " node_id must be valid" );
138
+
139
+ DATA_INVARIANT (!has_values.is_false () ||
140
+ (control_deps.empty () && data_deps.empty ()),
141
+ " If the domain is bottom, it must have no dependencies" );
142
+
143
+ return has_values.is_false ();
144
+ }
145
+
120
146
void set_node_id (node_indext id)
121
147
{
122
148
node_id=id;
0 commit comments