Skip to content

Commit 3b954ab

Browse files
committed
Remove conversion_failed(exprt, bvt)
This just invited the anti-pattern of uselessly building a bvt of a certain size when it got completely replaced by the function call anyway.
1 parent 66d9d17 commit 3b954ab

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/solvers/flattening/boolbv.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,6 @@ class boolbvt:public arrayst
124124
// NOLINTNEXTLINE(readability/identifiers)
125125
typedef arrayst SUB;
126126

127-
void conversion_failed(const exprt &expr, bvt &bv)
128-
{
129-
bv=conversion_failed(expr);
130-
}
131-
132127
bvt conversion_failed(const exprt &expr);
133128

134129
typedef std::unordered_map<const exprt, bvt, irep_hash> bv_cachet;

src/solvers/flattening/bv_pointers.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,7 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr)
382382

383383
auto bv_opt = convert_address_of_rec(address_of_expr.op());
384384
if(!bv_opt.has_value())
385-
{
386-
bvt bv;
387-
bv.resize(bits);
388-
conversion_failed(address_of_expr, bv);
389-
return bv;
390-
}
385+
return conversion_failed(address_of_expr);
391386

392387
CHECK_RETURN(bv_opt->size() == bits);
393388
return *bv_opt;
@@ -454,9 +449,7 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr)
454449
if(it->type().id()!=ID_unsignedbv &&
455450
it->type().id()!=ID_signedbv)
456451
{
457-
bvt failed_bv;
458-
conversion_failed(plus_expr, failed_bv);
459-
return failed_bv;
452+
return conversion_failed(plus_expr);
460453
}
461454

462455
bv_utilst::representationt rep=
@@ -492,9 +485,7 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr)
492485
minus_expr.rhs().type().id() != ID_unsignedbv &&
493486
minus_expr.rhs().type().id() != ID_signedbv)
494487
{
495-
bvt bv;
496-
conversion_failed(minus_expr, bv);
497-
return bv;
488+
return conversion_failed(minus_expr);
498489
}
499490

500491
const unary_minus_exprt neg_op1(minus_expr.rhs());

0 commit comments

Comments
 (0)