Skip to content

Commit 88ca2d4

Browse files
authored
Merge pull request #3151 from tautschnig/forall_macros-cleanup
guardt: Remove commented-out code (and clang-format specification cleanup)
2 parents d706af0 + 03dd6eb commit 88ca2d4

File tree

3 files changed

+0
-105
lines changed

3 files changed

+0
-105
lines changed

.clang-format

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ DisableFormat: 'false'
3131
ExperimentalAutoDetectBinPacking: 'false'
3232
ForEachMacros: [
3333
'forall_rw_range_set_r_objects',
34-
'Forall_rw_range_set_r_objects',
3534
'forall_rw_range_set_w_objects',
36-
'Forall_rw_range_set_w_objects',
3735
'forall_rw_set_r_entries',
38-
'Forall_rw_set_r_entries',
3936
'forall_rw_set_w_entries',
40-
'Forall_rw_set_w_entries',
4137
'forall_goto_functions',
4238
'Forall_goto_functions',
4339
'forall_goto_program_instructions',
@@ -47,31 +43,20 @@ ForEachMacros: [
4743
'forall_valid_objects',
4844
'Forall_valid_objects',
4945
'forall_nodes',
50-
'Forall_nodes',
5146
'forall_literals',
5247
'Forall_literals',
5348
'forall_operands',
5449
'Forall_operands',
5550
'forall_expr',
5651
'Forall_expr',
57-
'forall_expr_list',
58-
'Forall_expr_list',
5952
'forall_symbolptr_list',
6053
'Forall_symbolptr_list',
61-
'forall_guard',
62-
'Forall_guard',
6354
'forall_irep',
6455
'Forall_irep',
6556
'forall_named_irep',
6657
'Forall_named_irep',
6758
'forall_value_list',
68-
'Forall_value_list',
69-
'forall_symbols',
70-
'Forall_symbols',
7159
'forall_symbol_base_map',
72-
'Forall_symbol_base_map',
73-
'forall_symbol_module_map',
74-
'Forall_symbol_module_map',
7560
'forall_subtypes',
7661
'Forall_subtypes']
7762
IndentCaseLabels: 'false'

src/util/guard.cpp

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,6 @@ void guardt::guard_expr(exprt &dest) const
4040
}
4141
}
4242

43-
#if 0
44-
exprt guardt::as_expr(guard_listt::const_iterator it) const
45-
{
46-
if(it==guard_list.end())
47-
return true_exprt();
48-
else if(it==--guard_list.end())
49-
return guard_list.back();
50-
51-
exprt dest;
52-
dest=exprt(ID_and, typet(ID_bool));
53-
dest.reserve_operands(guard_list.size());
54-
for(; it!=guard_list.end(); it++)
55-
{
56-
PRECONDITION(it->is_boolean());
57-
dest.copy_to_operands(*it);
58-
}
59-
60-
return dest;
61-
}
62-
#endif
63-
6443
void guardt::add(const exprt &expr)
6544
{
6645
PRECONDITION(expr.type().id() == ID_bool);
@@ -202,32 +181,3 @@ guardt &operator |= (guardt &g1, const guardt &g2)
202181

203182
return g1;
204183
}
205-
206-
#if 0
207-
std::ostream &operator << (std::ostream &out, const guardt &g)
208-
{
209-
forall_expr_list(it, g.guard_list)
210-
out << "*** " << it->pretty() << '\n';
211-
return out;
212-
}
213-
214-
#define forall_guard(it, guard_list) \
215-
for(guardt::guard_listt::const_iterator it=(guard_list).begin(); \
216-
it!=(guard_list).end(); ++it)
217-
218-
bool guardt::is_false() const
219-
{
220-
forall_guard(it, guard_list)
221-
if(it->is_false())
222-
return true;
223-
224-
return false;
225-
}
226-
227-
void guardt::make_false()
228-
{
229-
guard_list.clear();
230-
guard_list.push_back(exprt());
231-
guard_list.back()=false_exprt();
232-
}
233-
#endif

src/util/guard.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,55 +38,15 @@ class guardt:public exprt
3838
add(guard);
3939
}
4040

41-
// exprt as_expr(guard_listt::const_iterator it) const;
42-
4341
exprt as_expr() const
4442
{
4543
return *this;
4644
}
4745

4846
void guard_expr(exprt &dest) const;
4947

50-
#if 0
51-
bool empty() const { return guard_list.empty(); }
52-
bool is_true() const { return empty(); }
53-
bool is_false() const;
54-
55-
void make_true()
56-
{
57-
guard_list.clear();
58-
}
59-
60-
void make_false();
61-
#endif
62-
6348
friend guardt &operator -= (guardt &g1, const guardt &g2);
6449
friend guardt &operator |= (guardt &g1, const guardt &g2);
65-
66-
#if 0
67-
void swap(guardt &g)
68-
{
69-
guard_list.swap(g.guard_list);
70-
}
71-
72-
size_type size() const
73-
{
74-
return guard_list.size();
75-
}
76-
77-
void resize(size_type s)
78-
{
79-
guard_list.resize(s);
80-
}
81-
82-
const guard_listt &get_guard_list() const
83-
{
84-
return guard_list;
85-
}
86-
87-
protected:
88-
guard_listt guard_list;
89-
#endif
9050
};
9151

9252
#endif // CPROVER_UTIL_GUARD_H

0 commit comments

Comments
 (0)