Lines Matching refs:hash
13 #include "abg-hash.h"
48 /// Compute a stable string hash.
50 /// std::hash has no portability or stability guarantees so is
60 /// @param str the string to hash.
62 /// @return an unsigned 32 bit hash value.
68 uint32_t hash = offset_basis;
72 hash = hash ^ byte;
73 hash = hash * prime;
75 return hash;
91 /// @param t the type to hash.
95 type_base::hash::operator()(const type_base& t) const
97 std::hash<size_t> size_t_hash;
98 std::hash<string> str_hash;
109 /// @param t the type to hash.
113 type_base::hash::operator()(const type_base* t) const
118 /// @param t the type to hash.
122 type_base::hash::operator()(const type_base_sptr t) const
125 struct decl_base::hash
130 std::hash<string> str_hash;
144 }; // end struct decl_base::hash
146 struct type_decl::hash
151 decl_base::hash decl_hash;
152 type_base::hash type_hash;
153 std::hash<string> str_hash;
165 /// @param d the scope_decl to hash.
167 /// @return the hash value.
169 scope_decl::hash::operator()(const scope_decl& d) const
171 std::hash<string> hash_string;
184 /// @param d the scope_decl to hash.
186 /// @return the hash value.
188 scope_decl::hash::operator()(const scope_decl* d) const
191 struct scope_type_decl::hash
196 decl_base::hash decl_hash;
197 type_base::hash type_hash;
198 std::hash<string> str_hash;
208 struct qualified_type_def::hash
213 type_base::hash type_hash;
214 decl_base::hash decl_hash;
215 std::hash<string> str_hash;
225 struct pointer_type_def::hash
230 std::hash<string> str_hash;
231 type_base::hash type_base_hash;
232 decl_base::hash decl_hash;
243 struct reference_type_def::hash
248 std::hash<string> hash_str;
249 type_base::hash hash_type_base;
250 decl_base::hash hash_decl;
264 struct array_type_def::subrange_type::hash
269 std::hash<int> hash_size_t;
276 struct array_type_def::hash
281 std::hash<string> hash_str;
282 type_base::hash hash_type_base;
283 decl_base::hash hash_decl;
285 array_type_def::subrange_type::hash hash_subrange;
303 struct enum_type_decl::hash
308 std::hash<string> str_hash;
309 decl_base::hash decl_hash;
311 std::hash<size_t> size_t_hash;
328 struct typedef_decl::hash
333 std::hash<string> str_hash;
334 type_base::hash hash_type;
335 decl_base::hash decl_hash;
346 /// Compute a hash for an instance @ref var_decl.
352 /// @param t the instance of @ref var_decl to compute the hash for.
354 /// @return the calculated hash value, or the one that was previously
357 var_decl::hash::operator()(const var_decl& t) const
359 std::hash<string> hash_string;
360 decl_base::hash hash_decl;
362 std::hash<size_t> hash_size_t;
377 /// Compute a hash for a pointer to @ref var_decl.
379 /// @param t the pointer to @ref var_decl to compute the hash for.
381 /// @return the calculated hash value
383 var_decl::hash::operator()(const var_decl* t) const
386 /// Compute a hash value for an instance of @ref function_decl.
388 /// Note that this function caches the resulting hash in the
392 /// @param t the function to calculate the hash for.
394 /// @return the hash value.
396 function_decl::hash::operator()(const function_decl& t) const
398 std::hash<int> hash_int;
399 std::hash<size_t> hash_size_t;
400 std::hash<bool> hash_bool;
401 std::hash<string> hash_string;
402 decl_base::hash hash_decl_base;
429 /// Compute a hash for a pointer to @ref function_decl.
431 /// @param t the pointer to @ref function_decl to compute the hash for.
433 /// @return the calculated hash value
435 function_decl::hash::operator()(const function_decl* t) const
439 function_decl::parameter::hash::operator()
443 std::hash<bool> hash_bool;
444 std::hash<unsigned> hash_unsigned;
452 function_decl::parameter::hash::operator()
457 function_decl::parameter::hash::operator()
462 struct method_type::hash
467 std::hash<string> hash_string;
469 function_decl::parameter::hash hash_parameter;
491 }; // end struct method_type::hash
493 // <struct function_type::hash stuff>
497 /// @param t the function type to hash.
499 /// @return the resulting hash value.
501 function_type::hash::operator()(const function_type& t) const
503 std::hash<string> hash_string;
505 function_decl::parameter::hash hash_parameter;
519 /// @param t the pointer to @ref function_type to hash.
521 /// @return the resulting hash value.
523 function_type::hash::operator()(const function_type* t) const
527 method_type::hash h;
535 /// @param t the pointer to @ref function_type to hash.
537 /// @return the resulting hash value.
539 function_type::hash::operator()(const function_type_sptr t) const
542 // </struct function_type::hash stuff>
545 member_base::hash::operator()(const member_base& m) const
547 std::hash<int> hash_int;
552 class_decl::base_spec::hash::operator()(const base_spec& t) const
554 member_base::hash hash_member;
556 std::hash<size_t> hash_size;
557 std::hash<bool> hash_bool;
558 std::hash<string> hash_string;
569 member_function_template::hash::operator()
572 std::hash<bool> hash_bool;
573 function_tdecl::hash hash_function_tdecl;
574 member_base::hash hash_member;
575 std::hash<string> hash_string;
587 member_class_template::hash::operator()
590 member_base::hash hash_member;
591 class_tdecl::hash hash_class_tdecl;
592 std::hash<string> hash_string;
601 /// Compute a hash for a @ref class_or_union
603 /// @param t the class_or_union for which to compute the hash value.
605 /// @return the computed hash value.
607 class_or_union::hash::operator()(const class_or_union& t) const
611 // All non-resolved decl-only types have a hash of zero. Their hash
612 // will differ from the resolved hash, but then at least, having
614 // the hash.
617 // If the type is decl-only and now has a definition, then hash its
630 std::hash<string> hash_string;
631 scope_type_decl::hash hash_scope_type;
632 var_decl::hash hash_data_member;
633 member_function_template::hash hash_member_fn_tmpl;
634 member_class_template::hash hash_member_class_tmpl;
648 // Do not hash member functions. All of them are not necessarily
671 /// Compute a hash for a @ref class_or_union
673 /// @param t the class_or_union for which to compute the hash value.
675 /// @return the computed hash value.
677 class_or_union::hash::operator()(const class_or_union *t) const
680 /// Compute a hash for a @ref class_decl
682 /// @param t the class_decl for which to compute the hash value.
684 /// @return the computed hash value.
686 class_decl::hash::operator()(const class_decl& t) const
690 // All non-resolved decl-only types have a hash of zero. Their hash
691 // will differ from the resolved hash, but then at least, having
693 // the hash.
697 // If the type is decl-only and now has a definition, then hash its
709 std::hash<string> hash_string;
710 class_decl::base_spec::hash hash_base;
711 class_or_union::hash hash_class_or_union;
734 /// Compute a hash for a @ref class_decl
736 /// @param t the class_decl for which to compute the hash value.
738 /// @return the computed hash value.
740 class_decl::hash::operator()(const class_decl* t) const
743 struct template_parameter::hash
758 std::hash<unsigned> hash_unsigned;
759 std::hash<std::string> hash_string;
760 template_decl::hash hash_template_decl;
787 template_decl::hash::operator()(const template_decl& t) const
789 std::hash<string> hash_string;
805 struct type_tparameter::hash
810 std::hash<string> hash_string;
811 template_parameter::hash hash_template_parameter;
812 type_decl::hash hash_type;
822 /// Compute a hash value for a @ref non_type_tparameter
826 /// @return the computed hash value.
828 non_type_tparameter::hash::operator()(const non_type_tparameter& t) const
830 template_parameter::hash hash_template_parameter;
831 std::hash<string> hash_string;
842 /// Compute a hash value for a @ref non_type_tparameter
844 /// @param t the non_type_tparameter to compute the hash value for.
846 /// @return the computed hash value.
848 non_type_tparameter::hash::operator()(const non_type_tparameter* t) const
851 struct template_tparameter::hash
856 std::hash<string> hash_string;
857 type_tparameter::hash hash_template_type_parm;
858 template_decl::hash hash_template_decl;
874 return template_tparameter::hash()(*p);
877 return type_tparameter::hash()(*p);
880 return non_type_tparameter::hash()(*p);
883 return template_parameter::hash()(*t);
886 /// Compute a hash value for a @ref type_composition type.
888 /// @param t the type_composition to compute the hash value for.
890 /// @return the computed hash value.
892 type_composition::hash::operator()(const type_composition& t) const
894 std::hash<string> hash_string;
902 /// Compute a hash value for a @ref type_composition type.
904 /// @param t the type_composition to compute the hash value for.
906 /// @return the computed hash value.
908 type_composition::hash::operator()(const type_composition* t) const
912 function_tdecl::hash::
915 std::hash<string> hash_string;
916 decl_base::hash hash_decl_base;
917 template_decl::hash hash_template_decl;
918 function_decl::hash hash_function_decl;
934 function_tdecl::hash hash_fn_tmpl_decl;
941 class_tdecl::hash::
944 std::hash<string> hash_string;
945 decl_base::hash hash_decl_base;
946 template_decl::hash hash_template_decl;
947 class_decl::hash hash_class_decl;
962 class_tdecl::hash hash_class_tmpl_decl;
980 /// broken in subtle ways. In pratice, the various *::hash functors
986 /// @return the resulting hash
995 return member_function_template::hash()(*d);
998 return member_class_template::hash()(*d);
1001 return template_tparameter::hash()(*d);
1004 return type_tparameter::hash()(*d);
1006 return type_decl::hash()(*d);
1008 return qualified_type_def::hash()(*d);
1010 return pointer_type_def::hash()(*d);
1012 return reference_type_def::hash()(*d);
1014 return array_type_def::hash()(*d);
1016 return enum_type_decl::hash()(*d);
1018 return typedef_decl::hash()(*d);
1020 return class_decl::hash()(*d);
1022 return union_decl::hash()(*d);
1024 return scope_type_decl::hash()(*d);
1026 return method_type::hash()(*d);
1028 return function_type::hash()(*d);
1031 return type_base::hash()(*t);