GCC Middle and Back End API Reference
hash-map.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  hash_map< KeyId, Value, Traits >
 
struct  hash_map< KeyId, Value, Traits >::hash_entry
 
class  hash_map< KeyId, Value, Traits >::iterator
 
class  hash_map< KeyId, Value, Traits >::iterator::reference_pair
 

Macros

#define DEFINE_PCH_HELPER(T)
 

Enumerations

enum  hm_alloc { hm_heap = false , hm_ggc = true }
 

Functions

template<typename K , typename V , typename H >
void gt_ggc_mx (hash_map< K, V, H > *h)
 
template<typename K , typename V , typename H >
void gt_pch_nx (hash_map< K, V, H > *h)
 
template<typename K , typename V , typename H >
void gt_cleare_cache (hash_map< K, V, H > *h)
 
template<typename K , typename V , typename H >
void gt_pch_nx (hash_map< K, V, H > *h, gt_pointer_operator op, void *cookie)
 
template<bool ggc, typename K , typename V , typename H >
hash_map< K, V, H > * hash_map_maybe_create (hash_map< K, V, H > *&h, size_t size=default_hash_map_size)
 
template<typename K , typename V , typename H >
V * hash_map_safe_get (hash_map< K, V, H > *h, const K &k)
 
template<bool ggc, typename K , typename V , typename H >
V & hash_map_safe_get_or_insert (hash_map< K, V, H > *&h, const K &k, bool *e=NULL, size_t size=default_hash_map_size)
 
template<bool ggc, typename K , typename V , typename H >
bool hash_map_safe_put (hash_map< K, V, H > *&h, const K &k, const V &v, size_t size=default_hash_map_size)
 

Variables

const size_t default_hash_map_size = 13
 

Macro Definition Documentation

◆ DEFINE_PCH_HELPER

#define DEFINE_PCH_HELPER ( T)
Value:
static void pch_nx_helper (T, gt_pointer_operator, void *) { }
void(* gt_pointer_operator)(void *, void *, void *)
Definition coretypes.h:473

Enumeration Type Documentation

◆ hm_alloc

enum hm_alloc
Enumerator
hm_heap 
hm_ggc 

Function Documentation

◆ gt_cleare_cache()

template<typename K , typename V , typename H >
void gt_cleare_cache ( hash_map< K, V, H > * h)
inline

◆ gt_ggc_mx()

template<typename K , typename V , typename H >
void gt_ggc_mx ( hash_map< K, V, H > * h)
inline
ggc marking routines.   

References gt_ggc_mx(), and hash_map< KeyId, Value, Traits >::m_table.

Referenced by gt_ggc_mx().

◆ gt_pch_nx() [1/2]

template<typename K , typename V , typename H >
void gt_pch_nx ( hash_map< K, V, H > * h)
inline

◆ gt_pch_nx() [2/2]

template<typename K , typename V , typename H >
void gt_pch_nx ( hash_map< K, V, H > * h,
gt_pointer_operator op,
void * cookie )
inline

◆ hash_map_maybe_create()

template<bool ggc, typename K , typename V , typename H >
hash_map< K, V, H > * hash_map_maybe_create ( hash_map< K, V, H > *& h,
size_t size = default_hash_map_size )
inline

◆ hash_map_safe_get()

template<typename K , typename V , typename H >
V * hash_map_safe_get ( hash_map< K, V, H > * h,
const K & k )
inline
Like h->get, but handles null h.   

References hash_map< KeyId, Value, Traits >::get(), and NULL.

◆ hash_map_safe_get_or_insert()

template<bool ggc, typename K , typename V , typename H >
V & hash_map_safe_get_or_insert ( hash_map< K, V, H > *& h,
const K & k,
bool * e = NULL,
size_t size = default_hash_map_size )
inline
Like h->get, but handles null h.   

References hash_map_maybe_create().

◆ hash_map_safe_put()

template<bool ggc, typename K , typename V , typename H >
bool hash_map_safe_put ( hash_map< K, V, H > *& h,
const K & k,
const V & v,
size_t size = default_hash_map_size )
inline
Like h->put, but handles null h.   

References hash_map_maybe_create().

Variable Documentation

◆ default_hash_map_size

const size_t default_hash_map_size = 13
A type-safe hash map.
   Copyright (C) 2014-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Class hash_map is a hash-value based container mapping objects of
KeyId type to those of the Value type.
Both KeyId and Value may be non-trivial (non-POD) types provided
a suitabe Traits class.  A few default Traits specializations are
provided for basic types such as integers, pointers, and std::pair.
Inserted elements are value-initialized either to zero for POD types
or by invoking their default ctor.  Removed elements are destroyed
by invoking their dtor.   On hash_map destruction all elements are
removed.  Objects of hash_map type are copy-constructible but not
assignable.