mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 09:55:19 +00:00
revert last two commits; MSVC doesn't like to statically allocate flexible arrays
This commit is contained in:
parent
6246c6517d
commit
c4fa719751
|
@ -707,8 +707,6 @@ struct app_flags {
|
||||||
app_flags() : m_depth(1), m_ground(1), m_has_quantifiers(0), m_has_labels(0) {}
|
app_flags() : m_depth(1), m_ground(1), m_has_quantifiers(0), m_has_labels(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace smt { class tmp_enode; }
|
|
||||||
|
|
||||||
class app : public expr {
|
class app : public expr {
|
||||||
friend class ast_manager;
|
friend class ast_manager;
|
||||||
|
|
||||||
|
@ -722,10 +720,8 @@ class app : public expr {
|
||||||
}
|
}
|
||||||
|
|
||||||
friend class tmp_app;
|
friend class tmp_app;
|
||||||
friend class smt::tmp_enode;
|
|
||||||
|
|
||||||
app(func_decl * decl, unsigned num_args, expr * const * args);
|
app(func_decl * decl, unsigned num_args, expr * const * args);
|
||||||
app() : expr(AST_APP) {}
|
|
||||||
public:
|
public:
|
||||||
func_decl * get_decl() const { return m_decl; }
|
func_decl * get_decl() const { return m_decl; }
|
||||||
family_id get_family_id() const { return get_decl()->get_family_id(); }
|
family_id get_family_id() const { return get_decl()->get_family_id(); }
|
||||||
|
|
|
@ -327,8 +327,10 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_enode::tmp_enode():
|
tmp_enode::tmp_enode():
|
||||||
|
m_app(0),
|
||||||
m_capacity(0),
|
m_capacity(0),
|
||||||
m_enode_data(nullptr) {
|
m_enode_data(nullptr) {
|
||||||
|
SASSERT(m_app.get_app()->get_decl() == 0);
|
||||||
set_capacity(5);
|
set_capacity(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +346,7 @@ namespace smt {
|
||||||
m_enode_data = alloc_svect(char, sz);
|
m_enode_data = alloc_svect(char, sz);
|
||||||
memset(m_enode_data, 0, sz);
|
memset(m_enode_data, 0, sz);
|
||||||
enode * n = get_enode();
|
enode * n = get_enode();
|
||||||
n->m_owner = &m_app;
|
n->m_owner = m_app.get_app();
|
||||||
n->m_root = n;
|
n->m_root = n;
|
||||||
n->m_next = n;
|
n->m_next = n;
|
||||||
n->m_class_size = 1;
|
n->m_class_size = 1;
|
||||||
|
@ -356,11 +358,12 @@ namespace smt {
|
||||||
if (num_args > m_capacity)
|
if (num_args > m_capacity)
|
||||||
set_capacity(num_args * 2);
|
set_capacity(num_args * 2);
|
||||||
enode * r = get_enode();
|
enode * r = get_enode();
|
||||||
m_app.m_decl = f;
|
m_app.set_decl(f);
|
||||||
m_app.m_num_args = num_args;
|
m_app.set_num_args(num_args);
|
||||||
r->m_commutative = num_args == 2 && f->is_commutative();
|
r->m_commutative = num_args == 2 && f->is_commutative();
|
||||||
memcpy(get_enode()->m_args, args, sizeof(enode*)*num_args);
|
memcpy(get_enode()->m_args, args, sizeof(enode*)*num_args);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ namespace smt {
|
||||||
void unmark_enodes2(unsigned num_enodes, enode * const * enodes);
|
void unmark_enodes2(unsigned num_enodes, enode * const * enodes);
|
||||||
|
|
||||||
class tmp_enode {
|
class tmp_enode {
|
||||||
app m_app;
|
tmp_app m_app;
|
||||||
unsigned m_capacity;
|
unsigned m_capacity;
|
||||||
char * m_enode_data;
|
char * m_enode_data;
|
||||||
enode * get_enode() { return reinterpret_cast<enode*>(m_enode_data); }
|
enode * get_enode() { return reinterpret_cast<enode*>(m_enode_data); }
|
||||||
|
|
Loading…
Reference in a new issue