GCC Middle and Back End API Reference
hash_set< KeyId, Lazy, Traits > Class Template Reference

#include <hash-set.h>

Inheritance diagram for hash_set< KeyId, Lazy, Traits >:
Collaboration diagram for hash_set< KeyId, Lazy, Traits >:

Data Structures

class  iterator
 

Public Types

typedef Traits::value_type Key
 

Public Member Functions

 hash_set (size_t n=13, bool ggc=false CXX_MEM_STAT_INFO)
 
bool add (const Key &k)
 
bool contains (const Key &k)
 
void remove (const Key &k)
 
template<typename Arg , bool(*)(const typename Traits::value_type &, Arg) f>
void traverse (Arg a) const
 
size_t elements () const
 
void empty ()
 
bool is_empty () const
 
iterator begin () const
 
iterator end () const
 

Static Public Member Functions

static hash_setcreate_ggc (size_t n)
 

Private Attributes

hash_table< Traits, Lazym_table
 

Friends

template<typename T , typename U >
void gt_ggc_mx (hash_set< T, false, U > *)
 
template<typename T , typename U >
void gt_pch_nx (hash_set< T, false, U > *)
 
template<typename T , typename U >
void gt_pch_nx (hash_set< T, false, U > *, gt_pointer_operator, void *)
 

Detailed Description

template<typename KeyId, bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
class hash_set< KeyId, Lazy, Traits >
A type-safe hash set.
   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_set is a hash-value based container for objects of
KeyId type.
KeyId may be a non-trivial (non-POD) type provided a suitabe Traits
class.  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_set destruction all elements are removed.  Objects of
hash_set type are copy-constructible but not assignable.   

Member Typedef Documentation

◆ Key

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
typedef Traits::value_type hash_set< KeyId, Lazy, Traits >::Key

Constructor & Destructor Documentation

◆ hash_set()

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
hash_set< KeyId, Lazy, Traits >::hash_set ( size_t n = 13,
bool ggc = false CXX_MEM_STAT_INFO )
inlineexplicit

Member Function Documentation

◆ add()

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
bool hash_set< KeyId, Lazy, Traits >::add ( const Key & k)
inline

References hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_checking_assert, ggc_alloc(), and hash_set< KeyId, Lazy, Traits >::m_table.

Referenced by nontrapping_dom_walker::add_or_mark_expr(), ipa_icf::sem_item::add_reference(), add_type_duplicate(), asan_expand_mark_ifn(), check_bool_pattern(), collect_subblocks(), compute_added_num_insns(), convert_local_reference_op(), debug_tree_chain(), DFS::DFS(), dump_callgraph_transformation(), execute_early_expand_coro_ifns(), expand_stack_vars(), find_comparison_args(), ana::exploded_graph::find_previous_entry_to(), find_uninit_use(), flatten_remove_node_hook(), form_subloop(), get_odr_type(), get_vectype_for_scalar_type(), gimplify_decl_expr(), go_format_type(), go_output_typedef(), go_output_var(), diagnostic_context::includes_seen_p(), sarif_builder::make_reporting_descriptor_reference_object_for_cwe_id(), sarif_builder::make_result_object(), mark_addressable_1(), ipa_param_body_adjustments::mark_clobbers_dead(), ipa_param_body_adjustments::mark_dead_statements(), sarif_builder::maybe_make_physical_location_object(), merge_latch_edges(), omp_firstprivatize_type_sizes(), ana::uncertainty_t::on_maybe_bound_sval(), ana::uncertainty_t::on_mutable_sval_at_unknown_call(), predicate_statements(), print_node(), propagate_threaded_block_debug_into(), prune_predictions_for_bb(), ipa_icf::sem_item_optimizer::remove_symtab_node(), update_counts_for_self_gen_clones(), used_types_insert_helper(), vect_analyze_data_ref_accesses(), vect_record_loop_mask(), vect_slp_analyze_operations(), vectorizable_operation(), vectorizable_simd_clone_call(), verify_gimple_in_cfg(), cgraph_node::verify_node(), walk_tree_1(), and write_symbol().

◆ begin()

◆ contains()

◆ create_ggc()

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
static hash_set * hash_set< KeyId, Lazy, Traits >::create_ggc ( size_t n)
inlinestatic

References ggc_alloc().

Referenced by used_types_insert_helper().

◆ elements()

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
size_t hash_set< KeyId, Lazy, Traits >::elements ( ) const
inline

◆ empty()

◆ end()

◆ is_empty()

◆ remove()

◆ traverse()

Friends And Related Symbol Documentation

◆ gt_ggc_mx

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
template<typename T , typename U >
void gt_ggc_mx ( hash_set< T, false, U > * )
friend

◆ gt_pch_nx [1/2]

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
template<typename T , typename U >
void gt_pch_nx ( hash_set< T, false, U > * )
friend

◆ gt_pch_nx [2/2]

template<typename KeyId , bool Lazy = false, typename Traits = default_hash_traits<KeyId>>
template<typename T , typename U >
void gt_pch_nx ( hash_set< T, false, U > * ,
gt_pointer_operator ,
void *  )
friend

Field Documentation

◆ m_table


The documentation for this class was generated from the following file: