3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

Catch exceptions by const-reference

Exceptions caught by value incur needless cost in C++, most of them can
be caught by const-reference, especially as nearly none are actually
used. This could allow compiler generate a slightly more efficient code.
This commit is contained in:
Michał Janiszewski 2018-10-12 21:15:31 +02:00
parent b301a59899
commit cfd0486582
36 changed files with 45 additions and 45 deletions

View file

@ -89,7 +89,7 @@ bool bv2real_util::contains_bv2real(expr* e) const {
try {
for_each_expr(p, e);
}
catch (contains_bv2real_proc::found) {
catch (const contains_bv2real_proc::found &) {
return true;
}
return false;

View file

@ -226,7 +226,7 @@ class fix_dl_var_tactic : public tactic {
}
return most_occs();
}
catch (failed) {
catch (const failed &) {
return nullptr;
}
}

View file

@ -156,7 +156,7 @@ class lia2pb_tactic : public tactic {
}
return true;
}
catch (failed) {
catch (const failed &) {
return false;
}
}

View file

@ -1034,7 +1034,7 @@ struct is_pb_probe : public probe {
return true;
}
catch (pb2bv_tactic::non_pb) {
catch (const pb2bv_tactic::non_pb &) {
return false;
}
}

View file

@ -371,7 +371,7 @@ class bv1_blaster_tactic : public tactic {
for_each_expr_core<visitor, expr_fast_mark1, false, true>(proc, visited, f);
}
}
catch (not_target) {
catch (const not_target &) {
return false;
}
return true;

View file

@ -195,7 +195,7 @@ bool test(goal const & g, Predicate & proc) {
for (unsigned i = 0; i < sz; i++)
quick_for_each_expr(proc, visited, g.form(i));
}
catch (typename Predicate::found) {
catch (const typename Predicate::found &) {
return true;
}
return false;

View file

@ -524,7 +524,7 @@ public:
}
return false;
}
catch (found) {
catch (const found &) {
return true;
}
}
@ -554,7 +554,7 @@ public:
}
return false;
}
catch (found) {
catch (const found &) {
return true;
}
}

View file

@ -870,7 +870,7 @@ bool ufbv_rewriter::match_subst::match_args(app * lhs, expr * const * args) {
m_cache.insert(p);
continue;
}
catch (match_args_aux_proc::no_match) {
catch (const match_args_aux_proc::no_match &) {
return false;
}
}