mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3 into jan4
This commit is contained in:
commit
8b47a84598
56 changed files with 5500 additions and 887 deletions
|
@ -89,9 +89,10 @@ public:
|
|||
m_nodes.shrink(sz);
|
||||
}
|
||||
|
||||
void push_back(T * n) {
|
||||
ref_vector_core& push_back(T * n) {
|
||||
inc_ref(n);
|
||||
m_nodes.push_back(n);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void pop_back() {
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
~scoped_ptr_vector() { reset(); }
|
||||
void reset() { std::for_each(m_vector.begin(), m_vector.end(), delete_proc<T>()); m_vector.reset(); }
|
||||
void push_back(T * ptr) { m_vector.push_back(ptr); }
|
||||
void pop_back() { SASSERT(!empty()); set(size()-1, 0); m_vector.pop_back(); }
|
||||
T * operator[](unsigned idx) const { return m_vector[idx]; }
|
||||
void set(unsigned idx, T * ptr) {
|
||||
if (m_vector[idx] == ptr)
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
m_elems_lim.push_back(m_elems_start);
|
||||
}
|
||||
|
||||
void pop_scopes(unsigned num_scopes) {
|
||||
void pop_scope(unsigned num_scopes) {
|
||||
if (num_scopes == 0) return;
|
||||
unsigned new_size = m_sizes.size() - num_scopes;
|
||||
unsigned src_lim = m_src_lim[new_size];
|
||||
|
@ -72,6 +72,12 @@ public:
|
|||
return m_elems[m_index[idx]];
|
||||
}
|
||||
|
||||
// breaks abstraction, caller must ensure backtracking.
|
||||
T& ref(unsigned idx) {
|
||||
SASSERT(idx < m_size);
|
||||
return m_elems[m_index[idx]];
|
||||
}
|
||||
|
||||
void set(unsigned idx, T const& t) {
|
||||
SASSERT(idx < m_size);
|
||||
unsigned n = m_index[idx];
|
||||
|
@ -102,6 +108,13 @@ public:
|
|||
SASSERT(invariant());
|
||||
}
|
||||
|
||||
void erase_and_swap(unsigned i) {
|
||||
if (i + 1 < size()) {
|
||||
set(i, m_elems[m_index[size()-1]]);
|
||||
}
|
||||
pop_back();
|
||||
}
|
||||
|
||||
unsigned size() const { return m_size; }
|
||||
|
||||
bool empty() const { return m_size == 0; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue