File tree Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ void uninitialized_domaint::transform(
31
31
ai_baset &ai,
32
32
const namespacet &ns)
33
33
{
34
+ if (is_bottom) return ;
35
+
34
36
switch (from->type )
35
37
{
36
38
case DECL:
@@ -96,11 +98,13 @@ void uninitialized_domaint::output(
96
98
const ai_baset &ai,
97
99
const namespacet &ns) const
98
100
{
99
- for (uninitializedt::const_iterator
100
- it=uninitialized.begin ();
101
- it!=uninitialized.end ();
102
- it++)
103
- out << *it << ' \n ' ;
101
+ if (is_bottom)
102
+ out << " BOTTOM" ;
103
+ else
104
+ {
105
+ for (const auto & id : uninitialized)
106
+ out << id << ' \n ' ;
107
+ }
104
108
}
105
109
106
110
/* ******************************************************************\
@@ -120,11 +124,16 @@ bool uninitialized_domaint::merge(
120
124
locationt from,
121
125
locationt to)
122
126
{
127
+ bool old_is_bottom=is_bottom;
128
+
129
+ is_bottom=is_bottom && other.is_bottom ;
130
+
123
131
unsigned old_uninitialized=uninitialized.size ();
124
132
125
133
uninitialized.insert (
126
134
other.uninitialized .begin (),
127
135
other.uninitialized .end ());
128
136
129
- return old_uninitialized!=uninitialized.size ();
137
+ return old_is_bottom!=is_bottom ||
138
+ old_uninitialized!=uninitialized.size ();
130
139
}
Original file line number Diff line number Diff line change @@ -16,7 +16,13 @@ Date: January 2010
16
16
class uninitialized_domaint :public ai_domain_baset
17
17
{
18
18
public:
19
- // locals that are not initialized
19
+ uninitialized_domaint ():is_bottom(true )
20
+ {
21
+ }
22
+
23
+ bool is_bottom;
24
+
25
+ // Locals that are declared but may not be initialized
20
26
typedef std::set<irep_idt> uninitializedt;
21
27
uninitializedt uninitialized;
22
28
@@ -33,17 +39,19 @@ class uninitialized_domaint:public ai_domain_baset
33
39
34
40
void make_top () override final
35
41
{
36
- uninitialized.clear ();
42
+ // We don't have a proper 'top', and refuse to do this.
43
+ assert (false );
37
44
}
38
45
39
46
void make_bottom () override final
40
47
{
41
48
uninitialized.clear ();
49
+ is_bottom=true ;
42
50
}
43
51
44
52
void make_entry () override final
45
53
{
46
- uninitialized. clear ();
54
+ make_top ();
47
55
}
48
56
49
57
// returns true iff there is s.th. new
You can’t perform that action at this time.
0 commit comments