Skip to content

Commit 248eed6

Browse files
Clean-up irep-id emptyness checks in util
1 parent 7ce9549 commit 248eed6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/util/find_symbols.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void find_symbols(kindt kind, const typet &src, find_symbols_sett &dest)
153153
find_symbols(kind, *it, dest);
154154

155155
// irep_idt identifier=it->get_identifier();
156-
// if(identifier!=irep_idt() && (kind==F_TYPE || kind==F_BOTH))
156+
// if(!identifier.empty() && (kind==F_TYPE || kind==F_BOTH))
157157
// dest.insert(identifier);
158158
}
159159
}

src/util/simplify_expr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2322,7 +2322,7 @@ bool simplify_exprt::simplify_rec(exprt &expr)
23222322
{
23232323
const exprt &new_expr=cache_result.first->second;
23242324

2325-
if(new_expr.id()==irep_idt())
2325+
if(new_expr.id().empty())
23262326
return true; // no change
23272327

23282328
expr=new_expr;

src/util/simplify_utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static bool sort_and_join(
9999
const struct saj_tablet &saj_entry,
100100
const irep_idt &type_id)
101101
{
102-
for(unsigned i=0; saj_entry.type_ids[i]!=irep_idt(); i++)
102+
for(unsigned i=0; !saj_entry.type_ids[i].empty(); i++)
103103
if(type_id==saj_entry.type_ids[i])
104104
return true;
105105

@@ -112,7 +112,7 @@ static const struct saj_tablet &sort_and_join(
112112
{
113113
unsigned i=0;
114114

115-
for( ; saj_table[i].id!=irep_idt(); i++)
115+
for( ; !saj_table[i].id.empty(); i++)
116116
if(id==saj_table[i].id &&
117117
sort_and_join(saj_table[i], type_id))
118118
return saj_table[i];
@@ -129,7 +129,7 @@ bool sort_and_join(exprt &expr)
129129

130130
const struct saj_tablet &saj_entry=
131131
sort_and_join(expr.id(), expr.type().id());
132-
if(saj_entry.id==irep_idt())
132+
if(saj_entry.id.empty())
133133
return true;
134134

135135
// check operand types

src/util/std_types.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Author: Daniel Kroening, [email protected]
1515
std::size_t fixedbv_typet::get_integer_bits() const
1616
{
1717
const irep_idt integer_bits=get(ID_integer_bits);
18-
assert(integer_bits!=irep_idt());
18+
assert(!integer_bits.empty());
1919
return unsafe_string2unsigned(id2string(integer_bits));
2020
}
2121

2222
std::size_t floatbv_typet::get_f() const
2323
{
2424
const irep_idt &f=get(ID_f);
25-
assert(f!=irep_idt());
25+
assert(!f.empty());
2626
return unsafe_string2unsigned(id2string(f));
2727
}
2828

0 commit comments

Comments
 (0)