GCC Middle and Back End API Reference
tree-hash-traits.h
Go to the documentation of this file.
1/* Traits for hashing trees.
2 Copyright (C) 2014-2024 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef tree_hash_traits_h
21#define tree_hash_traits_h
22
23/* Hash for trees based on operand_equal_p. */
24struct tree_operand_hash : ggc_ptr_hash <tree_node>
25{
26 static inline hashval_t hash (const value_type &);
27 static inline bool equal (const value_type &,
28 const compare_type &);
29};
30
31inline hashval_t
33{
34 return iterative_hash_expr (t, 0);
35}
36
37inline bool
39 const compare_type &t2)
40{
41 return operand_equal_p (t1, t2, 0);
42}
43
44#endif
bool operand_equal_p(const_tree arg0, const_tree arg1, unsigned int flags)
Definition fold-const.cc:4223
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
Definition hash-traits.h:321
Type * value_type
Definition hash-traits.h:169
Type * compare_type
Definition hash-traits.h:170
Definition tree-hash-traits.h:25
static hashval_t hash(const value_type &)
Definition tree-hash-traits.h:32
static bool equal(const value_type &, const compare_type &)
Definition tree-hash-traits.h:38
hashval_t iterative_hash_expr(const_tree tree, hashval_t seed)
Definition tree.h:5670