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)    static void pch_nx_helper (T, gt_pointer_operator, void *) { }
 

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 >
Vhash_map_safe_get (hash_map< K, V, H > *h, const K &k)
 
template<bool ggc, typename K , typename V , typename H >
Vhash_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)     static void pch_nx_helper (T, gt_pointer_operator, void *) { }

Enumeration Type Documentation

◆ 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

References ggc_alloc(), and gt_cleare_cache().

Referenced by gt_cleare_cache().

◆ 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 ggc_alloc(), and gt_ggc_mx().

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

References ggc_alloc(), and gt_pch_nx().

Referenced by gt_pch_nx().

◆ 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

References ggc_alloc(), and NULL.

◆ 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 ggc_alloc(), 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 ggc_alloc().

◆ 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 ggc_alloc().

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.