3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +00:00

merge with master

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-03-25 14:57:01 -07:00
commit c513f3ca09
883 changed files with 13979 additions and 16480 deletions

View file

@ -92,9 +92,9 @@ class ptr_hash_entry {
T * m_ptr;
public:
typedef T * data;
ptr_hash_entry():m_ptr(0) {}
ptr_hash_entry():m_ptr(nullptr) {}
unsigned get_hash() const { return m_hash; }
bool is_free() const { return m_ptr == 0; }
bool is_free() const { return m_ptr == nullptr; }
bool is_deleted() const { return m_ptr == reinterpret_cast<T *>(1); }
bool is_used() const { return m_ptr != reinterpret_cast<T *>(0) && m_ptr != reinterpret_cast<T *>(1); }
T * get_data() const { return m_ptr; }
@ -102,7 +102,7 @@ public:
void set_data(T * d) { m_ptr = d; }
void set_hash(unsigned h) { m_hash = h; }
void mark_as_deleted() { m_ptr = reinterpret_cast<T *>(1); }
void mark_as_free() { m_ptr = 0; }
void mark_as_free() { m_ptr = nullptr; }
};
@ -115,9 +115,9 @@ class ptr_addr_hash_entry : public ptr_hash_entry<T> {
T * m_ptr;
public:
typedef T * data;
ptr_addr_hash_entry():m_ptr(0) {}
ptr_addr_hash_entry():m_ptr(nullptr) {}
unsigned get_hash() const { return get_ptr_hash(m_ptr); }
bool is_free() const { return m_ptr == 0; }
bool is_free() const { return m_ptr == nullptr; }
bool is_deleted() const { return m_ptr == reinterpret_cast<T *>(1); }
bool is_used() const { return m_ptr != reinterpret_cast<T *>(0) && m_ptr != reinterpret_cast<T *>(1); }
T * get_data() const { return m_ptr; }
@ -146,7 +146,7 @@ protected:
void delete_table() {
dealloc_vect(m_table, m_capacity);
m_table = 0;
m_table = nullptr;
}
public:
@ -385,7 +385,7 @@ public:
entry * begin = m_table + idx;
entry * end = m_table + m_capacity;
entry * curr = begin;
entry * del_entry = 0;
entry * del_entry = nullptr;
for (; curr != end; ++curr) {
INSERT_LOOP_BODY();
}
@ -441,7 +441,7 @@ public:
entry * begin = m_table + idx;
entry * end = m_table + m_capacity;
entry * curr = begin;
entry * del_entry = 0;
entry * del_entry = nullptr;
for (; curr != end; ++curr) {
INSERT_LOOP_CORE_BODY();
}
@ -449,7 +449,7 @@ public:
INSERT_LOOP_CORE_BODY();
}
UNREACHABLE();
return 0;
return false;
}
bool insert_if_not_there_core(const data & e, entry * & et) {
@ -506,12 +506,12 @@ public:
for (curr = m_table; curr != begin; ++curr) {
FIND_LOOP_BODY();
}
return 0;
return nullptr;
}
bool find(data const & k, data & r) const {
entry * e = find_core(k);
if (e != 0) {
if (e != nullptr) {
r = e->get_data();
return true;
}
@ -519,7 +519,7 @@ public:
}
bool contains(data const & e) const {
return find_core(e) != 0;
return find_core(e) != nullptr;
}
iterator find(data const & e) const {
@ -602,9 +602,8 @@ public:
core_hashtable& operator|=(core_hashtable const& other) {
if (this == &other) return *this;
iterator i = other.begin(), e = other.end();
for (; i != e; ++i) {
insert(*i);
for (const data& d : other) {
insert(d);
}
return *this;
}
@ -612,10 +611,9 @@ public:
core_hashtable& operator&=(core_hashtable const& other) {
if (this == &other) return *this;
core_hashtable copy(*this);
iterator i = copy.begin(), e = copy.end();
for (; i != e; ++i) {
if (!other.contains(*i)) {
remove(*i);
for (const data& d : copy) {
if (!other.contains(d)) {
remove(d);
}
}
return *this;
@ -624,9 +622,8 @@ public:
core_hashtable& operator=(core_hashtable const& other) {
if (this == &other) return *this;
reset();
iterator i = other.begin(), e = other.end();
for (; i != e; ++i) {
insert(*i);
for (const data& d : other) {
insert(d);
}
return *this;
}