Skip to content

Commit 94b2145

Browse files
Move arguments into simplify_expr call
We use std::move in a few places where this is made possible by the change in interface.
1 parent 9b5685b commit 94b2145

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/analyses/ai_domain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ bool ai_domain_baset::ai_simplify_lhs(exprt &condition, const namespacet &ns)
4848
index_exprt ie = to_index_expr(condition);
4949
bool no_simplification = ai_simplify(ie.index(), ns);
5050
if(!no_simplification)
51-
condition = simplify_expr(ie, ns);
51+
condition = simplify_expr(std::move(ie), ns);
5252

5353
return no_simplification;
5454
}
@@ -57,7 +57,7 @@ bool ai_domain_baset::ai_simplify_lhs(exprt &condition, const namespacet &ns)
5757
dereference_exprt de = to_dereference_expr(condition);
5858
bool no_simplification = ai_simplify(de.pointer(), ns);
5959
if(!no_simplification)
60-
condition = simplify_expr(de, ns); // So *(&x) -> x
60+
condition = simplify_expr(std::move(de), ns); // So *(&x) -> x
6161

6262
return no_simplification;
6363
}
@@ -70,7 +70,7 @@ bool ai_domain_baset::ai_simplify_lhs(exprt &condition, const namespacet &ns)
7070
// must also be addressable
7171
bool no_simplification = ai_simplify_lhs(me.compound(), ns);
7272
if(!no_simplification)
73-
condition = simplify_expr(me, ns);
73+
condition = simplify_expr(std::move(me), ns);
7474

7575
return no_simplification;
7676
}

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ void custom_bitvector_domaint::transform(
529529
if(to!=from->get_target())
530530
guard = boolean_negate(guard);
531531

532-
exprt result=eval(guard, cba);
533-
exprt result2=simplify_expr(result, ns);
532+
const exprt result2 = simplify_expr(eval(guard, cba), ns);
534533

535534
if(result2.is_false())
536535
make_bottom();
@@ -787,7 +786,7 @@ void custom_bitvector_analysist::check(
787786

788787
exprt tmp = eval(i_it->get_condition(), i_it);
789788
const namespacet ns(goto_model.symbol_table);
790-
result=simplify_expr(tmp, ns);
789+
result = simplify_expr(std::move(tmp), ns);
791790

792791
description=i_it->source_location.get_comment();
793792
}

src/goto-analyzer/taint_analysis.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,7 @@ bool taint_analysist::operator()(
343343

344344
exprt result =
345345
custom_bitvector_analysis.eval(i_it->get_condition(), i_it);
346-
exprt result2=simplify_expr(result, ns);
347-
348-
if(result2.is_true())
346+
if(simplify_expr(std::move(result), ns).is_true())
349347
continue;
350348

351349
if(first)

src/solvers/lowering/byte_operators.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ exprt lower_byte_extract(const byte_extract_exprt &src, const namespacet &ns)
10121012
}
10131013

10141014
if(!failed)
1015-
return simplify_expr(s, ns);
1015+
return simplify_expr(std::move(s), ns);
10161016
}
10171017
else if(src.type().id() == ID_union || src.type().id() == ID_union_tag)
10181018
{
@@ -1183,7 +1183,7 @@ static exprt lower_byte_update_byte_array_vector(
11831183
result.add_to_operands(where, update_value);
11841184
}
11851185

1186-
return simplify_expr(result, ns);
1186+
return simplify_expr(std::move(result), ns);
11871187
}
11881188

11891189
/// Apply a byte update \p src to an array/vector typed operand, using the byte
@@ -1328,7 +1328,7 @@ static exprt lower_byte_update_array_vector_non_const(
13281328
result.add_to_operands(std::move(where), std::move(element));
13291329
}
13301330

1331-
return simplify_expr(result, ns);
1331+
return simplify_expr(std::move(result), ns);
13321332
}
13331333

13341334
/// Apply a byte update \p src to an array/vector typed operand using the byte

unit/solvers/strings/string_constraint_generator_valueof/is_digit_with_radix.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ static exprt actual(
2929
const namespacet ns(symtab);
3030

3131
return simplify_expr(
32-
is_digit_with_radix(chr, strict_formatting, radix_as_char, radix_ul), ns);
32+
is_digit_with_radix(
33+
std::move(chr), strict_formatting, radix_as_char, radix_ul),
34+
ns);
3335
}
3436

3537
/// Get the simplified return value of is_digit_with_radix called with a radix

0 commit comments

Comments
 (0)