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

fix a few compilation warnings

- remove unused variables and class fields
 - add support for gcc 4.5 & clang's __builtin_unreachable
 - fix 2 bugs related to strict aliasing
 - remove a few unused function parameters

Signed-off-by: Nuno Lopes <t-nclaud@microsoft.com>
This commit is contained in:
Nuno Lopes 2013-04-21 14:36:39 -07:00
parent 0673f645c9
commit 7ce88d4da9
46 changed files with 97 additions and 122 deletions

View file

@ -647,7 +647,6 @@ namespace datalog {
}
}
ast_manager& m = get_manager();
datalog::rule_manager& rm = get_rule_manager();
contains_pred contains_p(*this);
check_pred check_pred(contains_p, get_manager());

View file

@ -99,11 +99,9 @@ namespace datalog {
}
class interval_relation_plugin::rename_fn : public convenient_relation_rename_fn {
interval_relation_plugin& m_plugin;
public:
rename_fn(interval_relation_plugin& p, const relation_signature & orig_sig, unsigned cycle_len, const unsigned * cycle)
: convenient_relation_rename_fn(orig_sig, cycle_len, cycle),
m_plugin(p){
rename_fn(const relation_signature & orig_sig, unsigned cycle_len, const unsigned * cycle)
: convenient_relation_rename_fn(orig_sig, cycle_len, cycle) {
}
virtual relation_base * operator()(const relation_base & _r) {
@ -120,7 +118,7 @@ namespace datalog {
if(!check_kind(r)) {
return 0;
}
return alloc(rename_fn, *this, r.get_signature(), cycle_len, permutation_cycle);
return alloc(rename_fn, r.get_signature(), cycle_len, permutation_cycle);
}
interval interval_relation_plugin::unite(interval const& src1, interval const& src2) {
@ -194,11 +192,9 @@ namespace datalog {
}
class interval_relation_plugin::union_fn : public relation_union_fn {
interval_relation_plugin& m_plugin;
bool m_is_widen;
public:
union_fn(interval_relation_plugin& p, bool is_widen) :
m_plugin(p),
union_fn(bool is_widen) :
m_is_widen(is_widen) {
}
@ -223,7 +219,7 @@ namespace datalog {
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
return 0;
}
return alloc(union_fn, *this, false);
return alloc(union_fn, false);
}
relation_union_fn * interval_relation_plugin::mk_widen_fn(
@ -232,7 +228,7 @@ namespace datalog {
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
return 0;
}
return alloc(union_fn, *this, true);
return alloc(union_fn, true);
}
class interval_relation_plugin::filter_identical_fn : public relation_mutator_fn {

View file

@ -141,7 +141,6 @@ namespace datalog {
func_decl_ref_vector const& new_funcs() const { return m_new_funcs; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
rule_manager& rm = m_context.get_rule_manager();
bool found = false;
for (unsigned j = 0; !found && j < num; ++j) {
found = m_util.is_mkbv(args[j]);

View file

@ -527,11 +527,10 @@ namespace datalog {
}
class explanation_relation_plugin::intersection_filter_fn : public relation_intersection_filter_fn {
explanation_relation_plugin & m_plugin;
func_decl_ref m_union_decl;
public:
intersection_filter_fn(explanation_relation_plugin & plugin)
: m_plugin(plugin), m_union_decl(plugin.m_union_decl) {}
: m_union_decl(plugin.m_union_decl) {}
virtual void operator()(relation_base & tgt0, const relation_base & src0) {
explanation_relation & tgt = static_cast<explanation_relation &>(tgt0);

View file

@ -938,11 +938,8 @@ namespace datalog {
class karr_relation_plugin::union_fn : public relation_union_fn {
karr_relation_plugin& m_plugin;
public:
union_fn(karr_relation_plugin& p) :
m_plugin(p) {
}
union_fn() {}
virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) {
@ -966,7 +963,7 @@ namespace datalog {
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
return 0;
}
return alloc(union_fn, *this);
return alloc(union_fn);
}
class karr_relation_plugin::filter_identical_fn : public relation_mutator_fn {

View file

@ -320,9 +320,7 @@ namespace datalog {
if(!m_ground_unconditional_rule_heads.contains(pred)) {
m_ground_unconditional_rule_heads.insert(pred, alloc(obj_hashtable<app>));
}
obj_hashtable<app> * head_store;
m_ground_unconditional_rule_heads.find(pred, head_store);
head_store->insert(head);
m_ground_unconditional_rule_heads.find(pred)->insert(head);
next_rule:;
}

View file

@ -1090,12 +1090,10 @@ namespace datalog {
class relation_manager::default_table_rename_fn
: public convenient_table_rename_fn, auxiliary_table_transformer_fn {
const unsigned m_cycle_len;
public:
default_table_rename_fn(const table_signature & orig_sig, unsigned permutation_cycle_len,
const unsigned * permutation_cycle)
: convenient_table_rename_fn(orig_sig, permutation_cycle_len, permutation_cycle),
m_cycle_len(permutation_cycle_len) {
: convenient_table_rename_fn(orig_sig, permutation_cycle_len, permutation_cycle) {
SASSERT(permutation_cycle_len>=2);
}

View file

@ -661,17 +661,15 @@ namespace datalog {
SASSERT(res_idx<m_allocated_kinds.size());
ids.insert(spec, res_idx);
family_id2spec * idspecs;
VERIFY( m_kind_specs.find(sig, idspecs) );
family_id2spec * idspecs = m_kind_specs.find(sig);
idspecs->insert(m_allocated_kinds[res_idx], spec);
}
return m_allocated_kinds[res_idx];
}
void get_relation_spec(const relation_signature & sig, family_id kind, Spec & spec) {
family_id2spec * idspecs;
VERIFY( m_kind_specs.find(sig, idspecs) );
VERIFY( idspecs->find(kind, spec) );
family_id2spec * idspecs = m_kind_specs.find(sig);
spec = idspecs->find(kind);
}
};

View file

@ -198,8 +198,6 @@ namespace datalog {
{
bool values_match(const expr * v1, const expr * v2);
ast_manager & m_manager;
unsigned_vector m_args1;
unsigned_vector m_args2;
@ -211,7 +209,7 @@ namespace datalog {
static unsigned expr_cont_get_size(const ptr_vector<expr> & v) { return v.size(); }
static expr * expr_cont_get(const ptr_vector<expr> & v, unsigned i) { return v[i]; }
public:
variable_intersection(ast_manager & m) : m_manager(m), m_consts(m) {}
variable_intersection(ast_manager & m) : m_consts(m) {}
unsigned size() const {
return m_args1.size();

View file

@ -1028,7 +1028,6 @@ namespace nlarith {
};
class sqrt_subst : public isubst {
bool m_even;
sqrt_form const& m_s;
public:
sqrt_subst(imp& i, sqrt_form const& s): isubst(i), m_s(s) {}

View file

@ -1285,7 +1285,7 @@ namespace pdr {
obj_hashtable<func_decl>::iterator itf = deps.begin(), endf = deps.end();
for (; itf != endf; ++itf) {
TRACE("pdr", tout << mk_pp(pred, m) << " " << mk_pp(*itf, m) << "\n";);
VERIFY (rels.find(*itf, pt_user));
pt_user = rels.find(*itf);
pt_user->add_use(pt);
}
}

View file

@ -418,11 +418,10 @@ namespace pdr {
class farkas_learner::constant_replacer_cfg : public default_rewriter_cfg
{
ast_manager& m;
const obj_map<expr, expr *>& m_translation;
public:
constant_replacer_cfg(ast_manager& m, const obj_map<expr, expr *>& translation)
: m(m), m_translation(translation)
constant_replacer_cfg(const obj_map<expr, expr *>& translation)
: m_translation(translation)
{ }
bool get_subst(expr * s, expr * & t, proof * & t_pr) {

View file

@ -1093,8 +1093,7 @@ namespace qe {
bool has_branch(rational const& branch_id) const { return m_branch_index.contains(branch_id); }
search_tree* child(rational const& branch_id) const {
unsigned idx;
VERIFY(m_branch_index.find(branch_id, idx));
unsigned idx = m_branch_index.find(branch_id);
return m_children[idx];
}
@ -1963,7 +1962,6 @@ namespace qe {
expr_ref m_assumption;
bool m_produce_models;
ptr_vector<quant_elim_plugin> m_plugins;
unsigned m_name_counter; // fresh-id
volatile bool m_cancel;
bool m_eliminate_variables_as_block;
@ -1973,7 +1971,6 @@ namespace qe {
m_fparams(p),
m_assumption(m),
m_produce_models(m_fparams.m_model),
m_name_counter(0),
m_cancel(false),
m_eliminate_variables_as_block(true)
{

View file

@ -12,14 +12,12 @@ namespace qe {
// dl_plugin
class eq_atoms {
ast_manager& m;
expr_ref_vector m_eqs;
expr_ref_vector m_neqs;
app_ref_vector m_eq_atoms;
app_ref_vector m_neq_atoms;
public:
eq_atoms(ast_manager& m):
m(m),
m_eqs(m),
m_neqs(m),
m_eq_atoms(m),

View file

@ -740,7 +740,6 @@ namespace tb {
typedef svector<double> double_vector;
typedef obj_map<func_decl, double_vector> score_map;
typedef obj_map<app, double> pred_map;
datalog::context& m_ctx;
ast_manager& m;
datatype_util dt;
score_map m_score_map;
@ -750,19 +749,16 @@ namespace tb {
pred_map m_pred_map;
expr_ref_vector m_refs;
double m_weight_multiply;
unsigned m_num_invocations;
unsigned m_update_frequency;
unsigned m_next_update;
public:
selection(datalog::context& ctx):
m_ctx(ctx),
m(ctx.get_manager()),
dt(m),
m_refs(m),
m_weight_multiply(1.0),
m_num_invocations(0),
m_update_frequency(20),
m_next_update(20) {
set_strategy(ctx.get_params().tab_selection());