mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +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:
parent
b301a59899
commit
cfd0486582
36 changed files with 45 additions and 45 deletions
|
@ -422,7 +422,7 @@ namespace datalog {
|
|||
try {
|
||||
quick_for_each_expr(proc, fml);
|
||||
}
|
||||
catch (contains_predicate_proc::found) {
|
||||
catch (const contains_predicate_proc::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -219,7 +219,7 @@ private:
|
|||
quick_for_each_expr(m_proc, m_mark1, fml);
|
||||
m_mark1.reset();
|
||||
}
|
||||
catch (contains_predicate_proc::found) {
|
||||
catch (const contains_predicate_proc::found &) {
|
||||
m_mark1.reset();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2737,7 +2737,7 @@ lbool context::solve(unsigned from_lvl)
|
|||
// }
|
||||
}
|
||||
VERIFY (validate ());
|
||||
} catch (unknown_exception)
|
||||
} catch (const unknown_exception &)
|
||||
{}
|
||||
|
||||
if (m_last_result == l_true) {
|
||||
|
|
|
@ -95,7 +95,7 @@ bool farkas_learner::is_pure_expr(func_decl_set const& symbs, expr* e, ast_manag
|
|||
is_pure_expr_proc proc(symbs, m);
|
||||
try {
|
||||
for_each_expr(proc, e);
|
||||
} catch (is_pure_expr_proc::non_pure) {
|
||||
} catch (const is_pure_expr_proc::non_pure &) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -88,7 +88,7 @@ bool iuc_proof::is_core_pure(expr* e) const
|
|||
try {
|
||||
for_each_expr(proc, e);
|
||||
}
|
||||
catch (is_pure_expr_proc::non_pure)
|
||||
catch (const is_pure_expr_proc::non_pure &)
|
||||
{return false;}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -247,7 +247,7 @@ bool has_zk_const(expr *e){
|
|||
try {
|
||||
for_each_expr(p, e);
|
||||
}
|
||||
catch (has_zk_const_ns::found) {
|
||||
catch (const has_zk_const_ns::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -120,7 +120,7 @@ struct index_lt_proc : public std::binary_function<app*, app *, bool> {
|
|||
for (expr *e : v)
|
||||
quick_for_each_expr(fn, visited, e);
|
||||
}
|
||||
catch (has_nlira_functor::found ) {
|
||||
catch (const has_nlira_functor::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -891,7 +891,7 @@ namespace {
|
|||
for_each_expr(cs, fml);
|
||||
return false;
|
||||
}
|
||||
catch(found) {
|
||||
catch(const found &) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -415,7 +415,7 @@ namespace tb {
|
|||
try {
|
||||
quick_for_each_expr(p, t);
|
||||
}
|
||||
catch (non_constructor) {
|
||||
catch (const non_constructor &) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace {
|
|||
term_ite_proc f(m);
|
||||
try {
|
||||
quick_for_each_expr(f, e);
|
||||
} catch (term_ite_proc::found) {
|
||||
} catch (const term_ite_proc::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue