Skip to content

Commit 4477a72

Browse files
authored
Merge pull request #3783 from tautschnig/deprecation-binary_predicate_exprt
Construct binary_predicate_exprt in a non-deprecated way
2 parents 4022dfb + 1ef9809 commit 4477a72

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2420,7 +2420,8 @@ exprt c_typecheck_baset::do_special_functions(
24202420

24212421
irep_idt id = identifier == CPROVER_PREFIX "r_ok" ? ID_r_ok : ID_w_ok;
24222422

2423-
predicate_exprt ok_expr(id, expr.arguments()[0], expr.arguments()[1]);
2423+
binary_predicate_exprt ok_expr(
2424+
expr.arguments()[0], id, expr.arguments()[1]);
24242425
ok_expr.add_source_location() = source_location;
24252426

24262427
return std::move(ok_expr);

src/goto-analyzer/taint_analysis.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ void taint_analysist::instrument(
175175
case taint_parse_treet::rulet::SINK:
176176
{
177177
goto_programt::targett t=insert_before.add_instruction();
178-
binary_predicate_exprt get_may("get_may");
179-
get_may.op0()=where;
180-
get_may.op1()=address_of_exprt(string_constantt(rule.taint));
178+
binary_predicate_exprt get_may(
179+
where,
180+
"get_may",
181+
address_of_exprt(string_constantt(rule.taint)));
181182
t->make_assertion(not_exprt(get_may));
182183
t->source_location=instruction.source_location;
183184
t->source_location.set_property_class(

src/goto-instrument/thread_instrumentation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ void thread_exit_instrumentation(goto_programt &goto_program)
4141

4242
const string_constantt mutex_locked_string("mutex-locked");
4343

44-
binary_exprt get_may("get_may");
45-
4644
// NULL is any
47-
get_may.op0()=null_pointer_exprt(pointer_type(empty_typet()));
48-
get_may.op1()=address_of_exprt(mutex_locked_string);
45+
binary_predicate_exprt get_may(
46+
null_pointer_exprt(pointer_type(empty_typet())),
47+
"get_may",
48+
address_of_exprt(mutex_locked_string));
4949

5050
end->make_assertion(not_exprt(get_may));
5151

src/solvers/smt2/smt2_parser.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ exprt smt2_parsert::quantifier_expression(irep_idt id)
264264
// go backwards, build quantified expression
265265
for(auto r_it=bindings.rbegin(); r_it!=bindings.rend(); r_it++)
266266
{
267-
binary_predicate_exprt quantifier(id);
268-
quantifier.op0()=*r_it;
269-
quantifier.op1().swap(result);
267+
binary_predicate_exprt quantifier(*r_it, id, result);
270268
result=quantifier;
271269
}
272270

0 commit comments

Comments
 (0)