GCC Middle and Back End API Reference
|
#include <pointer-set.h>
Public Member Functions | |
pointer_map () | |
~pointer_map () | |
T * | contains (const void *p) |
T * | insert (const void *p, bool *existed_p=NULL) |
void | traverse (bool(*fn)(const void *, T *, void *), void *data) |
Protected Attributes | |
size_t | log_slots |
size_t | n_slots |
size_t | n_elements |
const void ** | slots |
Private Attributes | |
T * | values |
A pointer map is represented the same way as a pointer_set, so the hash code is based on the address of the key, rather than its contents. Null keys are a reserved value. Deletion is not supported (yet). There is no mechanism for user control of hash function, equality comparison, initial size, or resizing policy.
pointer_map< T >::pointer_map | ( | void | ) |
pointer_map< T >::~pointer_map | ( | void | ) |
Reclaims all memory associated with PMAP.
References slots.
T * pointer_map< T >::contains | ( | const void * | p | ) |
Returns a pointer to the value to which P maps, if PMAP contains P. P must be nonnull. Return NULL if PMAP does not contain P. Collisions are resolved by linear probing.
References pointer_set_lookup().
Referenced by iterate_fix_dominators(), and streamer_tree_cache_lookup().
T * pointer_map< T >::insert | ( | const void * | p, |
bool * | existed_p = NULL |
||
) |
Inserts P into PMAP if it wasn't already there. Returns a pointer to the value. P must be nonnull.
References pointer_set_lookup(), slots, and T.
Referenced by iterate_fix_dominators(), lto_output_decl_index(), and streamer_tree_cache_insert_1().
void pointer_map< T >::traverse | ( | bool(*)(const void *, T *, void *) | fn, |
void * | data | ||
) |
Pass each pointer in PMAP to the function in FN, together with the pointer to the value and the fixed parameter DATA. If FN returns false, the iteration stops.
References slots.
|
inherited |
Referenced by pointer_map_create(), pointer_map_insert(), pointer_set_create(), pointer_set_insert(), and pointer_set_lookup().
|
inherited |
Referenced by pointer_map_create(), pointer_map_insert(), pointer_set_create(), and pointer_set_insert().
|
inherited |
|
inherited |
|
private |