GCC Middle and Back End API Reference
|
#include <vec.h>
Public Types | |
using | pop_ret_type |
Public Member Functions | |
vec ()=default | |
vec (const vec &)=default | |
vec (vnull) | |
~vec ()=default | |
vec & | operator= (const vec &)=default |
template<size_t N> | |
vec (auto_vec< T, N > &)=delete | |
template<size_t N> | |
void | operator= (auto_vec< T, N > &)=delete |
void | create (unsigned nelems CXX_MEM_STAT_INFO) |
void | release (void) |
bool | exists (void) const |
bool | is_empty (void) const |
unsigned | allocated (void) const |
unsigned | length (void) const |
T * | address (void) |
const T * | address (void) const |
T * | begin () |
const T * | begin () const |
T * | end () |
const T * | end () const |
const T & | operator[] (unsigned ix) const |
bool | operator!= (const vec &other) const |
bool | operator== (const vec &other) const |
T & | operator[] (unsigned ix) |
T & | last (void) |
bool | space (int nelems) const |
bool | iterate (unsigned ix, T *p) const |
bool | iterate (unsigned ix, T **p) const |
vec | copy (ALONE_CXX_MEM_STAT_INFO) const |
bool | reserve (unsigned, bool=false CXX_MEM_STAT_INFO) |
bool | reserve_exact (unsigned CXX_MEM_STAT_INFO) |
void | splice (const vec &) |
void | safe_splice (const vec &CXX_MEM_STAT_INFO) |
T * | quick_push (const T &) |
T * | safe_push (const T &CXX_MEM_STAT_INFO) |
pop_ret_type | pop (void) |
void | truncate (unsigned) |
void | safe_grow (unsigned, bool=false CXX_MEM_STAT_INFO) |
void | safe_grow_cleared (unsigned, bool=false CXX_MEM_STAT_INFO) |
void | quick_grow (unsigned) |
void | quick_grow_cleared (unsigned) |
void | quick_insert (unsigned, const T &) |
void | safe_insert (unsigned, const T &CXX_MEM_STAT_INFO) |
void | ordered_remove (unsigned) |
void | unordered_remove (unsigned) |
void | block_remove (unsigned, unsigned) |
void | qsort (int(*)(const void *, const void *)) |
void | sort (int(*)(const void *, const void *, void *), void *) |
void | stablesort (int(*)(const void *, const void *, void *), void *) |
T * | bsearch (const void *key, int(*compar)(const void *, const void *)) |
T * | bsearch (const void *key, int(*compar)(const void *, const void *, void *), void *) |
unsigned | lower_bound (T, bool(*)(const T &, const T &)) const |
bool | contains (const T &search) const |
void | reverse (void) |
bool | using_auto_storage () const |
Data Fields | |
vec< T, va_heap, vl_embed > * | m_vec |
Referenced by block_remove(), bsearch(), bsearch(), contains(), copy(), create(), iterate(), iterate(), lower_bound(), operator!=(), operator=(), operator==(), ordered_remove(), pop(), qsort(), quick_grow(), quick_grow_cleared(), quick_insert(), quick_push(), release(), reserve(), reserve_exact(), reverse(), safe_grow(), safe_grow_cleared(), safe_insert(), safe_push(), safe_splice(), sort(), splice(), stablesort(), truncate(), unordered_remove(), using_auto_storage(), and vec().
References vec().
|
delete |
References m_vec.
|
inline |
Return a copy of this vector.
References ALONE_MEM_STAT_DECL, ALONE_PASS_MEM_STAT, length(), m_vec, and vec().
Create the internal vector and reserve NELEMS for it. This is exactly like vec::reserve, but the internal vector is unconditionally allocated from scratch. The old one, if it existed, is lost.
References m_vec, MEM_STAT_DECL, NULL, PASS_MEM_STAT, reserve_exact(), and vec().
Referenced by operator=().
References m_vec.
References m_vec.
Referenced by copy(), end(), end(), reverse(), safe_grow(), and safe_grow_cleared().
|
inline |
References vec().
|
delete |
References create(), CXX_MEM_STAT_INFO, and release().
|
default |
References vec().
Same as vec::safe_grow but without reallocation of the internal vector. If the vector cannot be extended, a runtime assertion will be triggered.
References gcc_checking_assert, m_vec, and vec().
Same as vec::quick_grow_cleared but without reallocation of the internal vector. If the vector cannot be extended, a runtime assertion will be triggered.
References gcc_checking_assert, m_vec, and vec().
|
inline |
Insert an element, OBJ, at the IXth position of this vector. There must be sufficient space.
References m_vec, T, and vec().
Referenced by safe_insert().
Push OBJ (a new element) onto the end of the vector. There must be sufficient space in the vector. Return a pointer to the slot where OBJ was inserted.
References m_vec, T, and vec().
Referenced by safe_push().
Free the memory occupied by the embedded vector.
References m_vec, va_heap::release(), using_auto_storage(), and vec().
Referenced by operator=().
|
inline |
Ensure that the vector has at least RESERVE slots available (if EXACT is false), or exactly RESERVE slots available (if EXACT is true). This may create additional headroom if EXACT is false. Note that this can cause the embedded vector to be reallocated. Returns true iff reallocation actually occurred.
References m_vec, MEM_STAT_DECL, NULL, PASS_MEM_STAT, va_heap::reserve(), space(), using_auto_storage(), vec(), and vec_copy_construct().
Referenced by reserve_exact(), safe_grow(), safe_grow_cleared(), safe_insert(), and safe_push().
|
inline |
Ensure that this vector has exactly NELEMS slots available. This will not create additional headroom. Note this can cause the embedded vector to be reallocated. Returns true iff reallocation actually occurred.
References MEM_STAT_DECL, PASS_MEM_STAT, reserve(), and vec().
Referenced by create(), and safe_splice().
|
inline |
Grow the vector to a specific length. LEN must be as long or longer than the current length. The new elements are uninitialized. Reallocate the internal vector, if needed.
References gcc_checking_assert, length(), m_vec, MEM_STAT_DECL, PASS_MEM_STAT, reserve(), and vec().
|
inline |
Grow the embedded vector to a specific length. LEN must be as long or longer than the current length. The new elements are initialized to zero. Reallocate the internal vector, if needed.
References gcc_checking_assert, length(), m_vec, MEM_STAT_DECL, PASS_MEM_STAT, reserve(), and vec().
|
inline |
Insert an element, OBJ, at the IXth position of the vector. Reallocate the embedded vector, if necessary.
References MEM_STAT_DECL, PASS_MEM_STAT, quick_insert(), reserve(), T, and vec().
Push a new element OBJ onto the end of this vector. Reallocates the embedded vector, if needed. Return a pointer to the slot where OBJ was inserted.
References MEM_STAT_DECL, PASS_MEM_STAT, quick_push(), reserve(), T, and vec().
|
inline |
Copy the elements in SRC to the end of this vector as if by memcpy. SRC and this vector must be allocated with the same mechanism. If there is not enough headroom in this vector, it will be reallocated as needed.
References MEM_STAT_DECL, reserve_exact(), splice(), and vec().
|
inline |
Copy the elements from SRC to the end of this vector as if by memcpy. SRC and this vector must be allocated with the same memory allocation mechanism. This vector is assumed to have sufficient headroom available.
Referenced by safe_splice().
Set the length of the vector to LEN. The new length must be less than or equal to the current length. This is an O(1) operation.
References gcc_checking_assert, m_vec, and vec().
Referenced by address(), address(), allocated(), block_remove(), bsearch(), bsearch(), contains(), copy(), create(), exists(), is_empty(), iterate(), iterate(), last(), length(), lower_bound(), operator[](), operator[](), ordered_remove(), pop(), qsort(), quick_grow(), quick_grow_cleared(), quick_insert(), quick_push(), release(), reserve(), safe_grow(), safe_grow_cleared(), sort(), space(), splice(), stablesort(), truncate(), unordered_remove(), using_auto_storage(), and vec().