Skip to content

Commit 737c220

Browse files
committed
delete more default constructors
reduces code size by 0.1%
1 parent 4b4a282 commit 737c220

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+35
-91
lines changed

src/ackermannization/ackr_bound_probe.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ class ackr_bound_probe : public probe {
6060
};
6161

6262
public:
63-
ackr_bound_probe() {}
64-
6563
result operator()(goal const & g) override {
6664
proc p(g.m());
6765
unsigned sz = g.size();

src/ast/converters/model_converter.h

-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ class model_converter : public converter {
7171
void display_del(std::ostream& out, func_decl* f) const;
7272
void display_add(std::ostream& out, ast_manager& m);
7373
public:
74-
75-
model_converter() {}
76-
7774
void set_completion(bool f) { m_completion = f; }
7875

7976
virtual void operator()(model_ref & m) = 0;

src/ast/recfun_decl_plugin.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ namespace recfun {
417417
}
418418

419419
namespace decl {
420-
plugin::plugin() : decl_plugin(), m_defs(), m_case_defs() {}
421420
plugin::~plugin() { finalize(); }
422421

423422
void plugin::finalize() {

src/ast/recfun_decl_plugin.h

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ namespace recfun {
173173
void compute_scores(expr* e, obj_map<expr, unsigned>& scores);
174174

175175
public:
176-
plugin();
177176
~plugin() override;
178177
void finalize() override;
179178

src/ast/rewriter/var_subst.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class expr_free_vars {
9494
ptr_vector<sort> m_sorts;
9595
ptr_vector<expr> m_todo;
9696
public:
97-
expr_free_vars() {}
97+
expr_free_vars() = default;
9898
expr_free_vars(expr* e) { (*this)(e); }
9999
void reset();
100100
void operator()(expr* e);

src/ast/simplifiers/linear_equation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class linear_equation {
3535
mpz * m_as; // precise coefficients
3636
double * m_approx_as; // approximated coefficients
3737
var * m_xs; // var ids
38-
linear_equation() {}
38+
linear_equation() = default;
3939
public:
4040
unsigned size() const { return m_size; }
4141
mpz const & a(unsigned idx) const { SASSERT(idx < m_size); return m_as[idx]; }

src/cmd_context/cmd_context.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class func_decls {
4747
bool signatures_collide(func_decl* f, func_decl* g) const;
4848
bool signatures_collide(unsigned n, sort*const* domain, sort* range, func_decl* g) const;
4949
public:
50-
func_decls() {}
50+
func_decls() = default;
5151
func_decls(ast_manager & m, func_decl * f);
5252
void finalize(ast_manager & m);
5353
bool contains(func_decl * f) const;

src/math/interval/mod_interval.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace bv {
2626
bool tight = true;
2727

2828
interval_tpl(T const& l, T const& h, unsigned sz, bool tight = false): l(l), h(h), sz(sz), tight(tight) {}
29-
interval_tpl() {}
29+
interval_tpl() = default;
3030

3131
bool invariant() const {
3232
return
@@ -167,7 +167,7 @@ namespace bv {
167167
iinterval i;
168168
rinterval r;
169169

170-
interval() {}
170+
interval() = default;
171171

172172
interval(rational const& l, rational const& h, unsigned sz, bool tight = false) {
173173
if (sz <= 64) {

src/math/lp/factorization.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class factor {
2424
factor_type m_type = factor_type::VAR;
2525
bool m_sign = false;
2626
public:
27-
factor() { }
27+
factor() = default;
2828
explicit factor(lpvar v, factor_type t) : m_var(v), m_type(t) {}
2929
unsigned var() const { return m_var; }
3030
factor_type type() const { return m_type; }

src/math/lp/indexed_value.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class indexed_value {
2929
// m_other is the offset of the corresponding element in its vector : for a row element it points to the column element offset,
3030
// for a column element it points to the row element offset
3131
unsigned m_other;
32-
indexed_value() {}
32+
indexed_value() = default;
3333

3434
indexed_value(T v, unsigned i, unsigned other) :
3535
m_value(v), m_index(i), m_other(other) {

src/math/lp/nex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class nex {
9292
virtual const rational& coeff() const { return rational::one(); }
9393

9494
#ifdef Z3DEBUG
95-
virtual void sort() {};
95+
virtual void sort() {}
9696
#endif
9797
bool virtual is_linear() const = 0;
9898
};

src/math/lp/numeric_pair.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,7 @@ template <typename T>
116116
struct numeric_pair {
117117
T x;
118118
T y;
119-
// empty constructor
120-
numeric_pair() {}
121-
// another constructor
122-
119+
numeric_pair() = default;
123120
numeric_pair(T xp, T yp) : x(xp), y(yp) {}
124121

125122
template <typename X>

src/math/lp/permutation_matrix.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class permutation_matrix
5252
};
5353

5454
public:
55-
permutation_matrix() {}
55+
permutation_matrix() = default;
5656
permutation_matrix(unsigned length);
5757

5858
permutation_matrix(unsigned length, vector<unsigned> const & values);

src/math/lp/stacked_vector.h

-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ template < typename B> class stacked_vector {
9898
}
9999
}
100100
public:
101-
102-
stacked_vector() { }
103-
104101
ref operator[] (unsigned a) {
105102
return ref(*this, a);
106103
}

src/math/lp/static_matrix.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class static_matrix
105105
void init_row_columns(unsigned m, unsigned n);
106106

107107
// constructor with no parameters
108-
static_matrix() {}
108+
static_matrix() = default;
109109

110110
// constructor
111111
static_matrix(unsigned m, unsigned n): m_vector_of_row_offsets(n, -1) {

src/math/lp/var_eqs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class var_eqs {
8181

8282
mutable stats m_stats;
8383
public:
84-
var_eqs(): m_merge_handler(nullptr), m_uf(*this), m_stack() {}
84+
var_eqs(): m_merge_handler(nullptr), m_uf(*this) {}
8585
/**
8686
\brief push a scope */
8787
void push() {

src/math/lp/var_register.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ext_var_info {
2727
bool m_is_integer;
2828
std::string m_name;
2929
public:
30-
ext_var_info() {}
30+
ext_var_info() = default;
3131
ext_var_info(unsigned j): ext_var_info(j, true) {}
3232
ext_var_info(unsigned j , bool is_int) : m_external_j(j), m_is_integer(is_int) {}
3333
ext_var_info(unsigned j , bool is_int, std::string name) : m_external_j(j), m_is_integer(is_int), m_name(name) {}

src/math/polynomial/polynomial.cpp

+4-10
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace polynomial {
9191
*/
9292
class power : public std::pair<var, unsigned> {
9393
public:
94-
power():std::pair<var, unsigned>() {}
94+
power() = default;
9595
power(var v, unsigned d):std::pair<var, unsigned>(v, d) {}
9696
var get_var() const { return first; }
9797
unsigned degree() const { return second; }
@@ -1895,7 +1895,7 @@ namespace polynomial {
18951895
Invoke add(...), addmul(...) several times, and then invoke mk() to obtain the final polynomial.
18961896
*/
18971897
class som_buffer {
1898-
imp * m_owner;
1898+
imp * m_owner = nullptr;
18991899
monomial2pos m_m2pos;
19001900
numeral_vector m_tmp_as;
19011901
monomial_vector m_tmp_ms;
@@ -1939,8 +1939,6 @@ namespace polynomial {
19391939
}
19401940

19411941
public:
1942-
som_buffer():m_owner(nullptr) {}
1943-
19441942
void reset() {
19451943
if (empty())
19461944
return;
@@ -2236,12 +2234,10 @@ namespace polynomial {
22362234
In this buffer, each monomial can be added at most once.
22372235
*/
22382236
class cheap_som_buffer {
2239-
imp * m_owner;
2237+
imp * m_owner = nullptr;
22402238
numeral_vector m_tmp_as;
22412239
monomial_vector m_tmp_ms;
22422240
public:
2243-
cheap_som_buffer():m_owner(nullptr) {}
2244-
22452241
void set_owner(imp * o) { m_owner = o; }
22462242
bool empty() const { return m_tmp_ms.empty(); }
22472243

@@ -3072,11 +3068,9 @@ namespace polynomial {
30723068
}
30733069

30743070
class newton_interpolator_vector {
3075-
imp * m_imp;
3071+
imp * m_imp = nullptr;
30763072
ptr_vector<newton_interpolator> m_data;
30773073
public:
3078-
newton_interpolator_vector():m_imp(nullptr) {}
3079-
30803074
~newton_interpolator_vector() {
30813075
flush();
30823076
}

src/math/polynomial/upolynomial_factorization_int.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace upolynomial {
6464

6565
public:
6666

67-
factorization_degree_set() { }
67+
factorization_degree_set() = default;
6868

6969
factorization_degree_set(zp_factors const & factors)
7070
{

src/math/simplex/model_based_opt.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace opt {
4343
struct var {
4444
unsigned m_id { 0 };
4545
rational m_coeff;
46-
var() {}
46+
var() = default;
4747
var(unsigned id, rational const& c): m_id(id), m_coeff(c) {}
4848
struct compare {
4949
bool operator()(var x, var y) {
@@ -76,11 +76,11 @@ namespace opt {
7676

7777
// A definition is a linear term of the form (vars + coeff) / div
7878
struct def {
79-
def(): m_div(1) {}
79+
def() = default;
8080
def(row const& r, unsigned x);
8181
vector<var> m_vars;
8282
rational m_coeff;
83-
rational m_div;
83+
rational m_div{1};
8484
def operator+(def const& other) const;
8585
def operator/(unsigned n) const { return *this / rational(n); }
8686
def operator/(rational const& n) const;

src/muz/base/dl_util.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,6 @@ namespace datalog {
393393

394394
class skip_model_converter : public model_converter {
395395
public:
396-
skip_model_converter() {}
397-
398396
model_converter * translate(ast_translation & translator) override {
399397
return alloc(skip_model_converter);
400398
}

src/muz/fp/dl_cmds.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ struct dl_context {
5656
m_cmd(ctx),
5757
m_collected_cmds(collected_cmds),
5858
m_ref_count(0),
59-
m_decl_plugin(nullptr),
60-
m_trail() {}
59+
m_decl_plugin(nullptr) {}
6160

6261
void inc_ref() {
6362
++m_ref_count;

src/muz/rel/dl_mk_simple_joins.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ namespace datalog {
5454
var_idx_set m_all_nonlocal_vars;
5555
rule_vector m_rules;
5656

57-
pair_info() {}
58-
5957
pair_info & operator=(const pair_info &) = delete;
6058
bool can_be_joined() const {
6159
return m_consumers > 0;

src/muz/rel/dl_relation_manager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,6 @@ namespace datalog {
10431043
class relation_manager::null_signature_table_project_fn : public table_transformer_fn {
10441044
const table_signature m_empty_sig;
10451045
public:
1046-
null_signature_table_project_fn() : m_empty_sig() {}
10471046
table_base * operator()(const table_base & t) override {
10481047
relation_manager & m = t.get_plugin().get_manager();
10491048
table_base * res = m.mk_empty_table(m_empty_sig);

src/muz/rel/dl_sieve_relation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace datalog {
3636
/**
3737
Create uninitialized rel_spec.
3838
*/
39-
rel_spec() {}
39+
rel_spec() = default;
4040
/**
4141
\c inner_kind==null_family_id means we will not specify a relation kind when requesting
4242
the relation object from the relation_manager.

src/muz/rel/karr_relation.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,6 @@ namespace datalog {
674674

675675
class karr_relation_plugin::union_fn : public relation_union_fn {
676676
public:
677-
union_fn() {}
678-
679677
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
680678

681679
karr_relation& r = get(_r);

src/muz/rel/udoc_relation.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,6 @@ namespace datalog {
491491
}
492492
class udoc_plugin::union_fn : public relation_union_fn {
493493
public:
494-
union_fn() {}
495-
496494
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
497495
TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
498496
udoc_relation& r = get(_r);
@@ -1040,8 +1038,6 @@ namespace datalog {
10401038

10411039
class udoc_plugin::join_project_and_fn : public relation_join_fn {
10421040
public:
1043-
join_project_and_fn() {}
1044-
10451041
relation_base* operator()(relation_base const& t1, relation_base const& t2) override {
10461042
udoc_relation *result = get(t1.clone());
10471043
result->get_udoc().intersect(result->get_dm(), get(t2).get_udoc());

src/muz/spacer/spacer_arith_kernel.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ bool spacer_arith_kernel::compute_kernel() {
4545
namespace {
4646
class simplex_arith_kernel_plugin : public spacer_arith_kernel::plugin {
4747
public:
48-
simplex_arith_kernel_plugin() {}
49-
5048
bool compute_kernel(const spacer_matrix &in, spacer_matrix &out,
5149
vector<unsigned> &basics) override {
5250
using qmatrix = simplex::sparse_matrix<simplex::mpq_ext>;

src/muz/transforms/dl_mk_magic_sets.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace datalog {
6565
func_decl * m_pred;
6666
adornment m_adornment;
6767

68-
adornment_desc() {}
68+
adornment_desc() = default;
6969
adornment_desc(func_decl * pred) : m_pred(pred) {}
7070
adornment_desc(func_decl * pred, const adornment & a)
7171
: m_pred(pred), m_adornment(a) {}

src/opt/maxcore.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ class maxcore : public maxsmt_solver_base {
777777
ptr_vector<expr> es;
778778
unsigned k = 0;
779779
rational weight;
780-
bound_info() {}
780+
bound_info() = default;
781781
bound_info(ptr_vector<expr> const& es, unsigned k, rational const& weight):
782782
es(es), k(k), weight(weight) {}
783783
bound_info(expr_ref_vector const& es, unsigned k, rational const& weight):

src/sat/sat_ddfw.h

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ namespace sat {
9595
};
9696

9797
struct var_info {
98-
var_info() {}
9998
bool m_value = false;
10099
double m_reward = 0;
101100
double m_last_reward = 0;

src/sat/smt/arith_solver.h

-8
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,11 @@ namespace arith {
428428
* Facility to put a small box around integer variables used in branch and bounds.
429429
*/
430430

431-
struct bound_info {
432-
rational m_offset;
433-
unsigned m_range;
434-
bound_info() {}
435-
bound_info(rational const& o, unsigned r) :m_offset(o), m_range(r) {}
436-
};
437431
unsigned m_bounded_range_idx; // current size of bounded range.
438432
literal m_bounded_range_lit; // current bounded range literal
439433
expr_ref_vector m_bound_terms; // predicates used for bounds
440434
expr_ref m_bound_predicate;
441435

442-
obj_map<expr, expr*> m_predicate2term;
443-
obj_map<expr, bound_info> m_term2bound_info;
444436
bool m_model_is_initialized = false;
445437

446438
unsigned small_lemma_size() const { return get_config().m_arith_small_lemma_size; }

src/sat/smt/q_mam.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace q {
3939
class mam {
4040
friend class mam_impl;
4141

42-
mam() {}
42+
mam() = default;
4343

4444
public:
4545

src/smt/params/theory_array_params.h

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ struct theory_array_params {
4141
unsigned m_array_lazy_ieq_delay = 10;
4242
bool m_array_fake_support = false; // fake support for all array operations to pretend they are satisfiable.
4343

44-
theory_array_params() {}
45-
4644
void updt_params(params_ref const & _p);
4745

4846
void display(std::ostream & out) const;

0 commit comments

Comments
 (0)