13#ifndef __ABG_IR_PRIV_H__
14#define __ABG_IR_PRIV_H__
35 COMPARISON_RESULT_DIFFERENT = 0,
36 COMPARISON_RESULT_EQUAL = 1,
37 COMPARISON_RESULT_CYCLE_DETECTED = 2,
38 COMPARISON_RESULT_UNKNOWN = 3,
120 operator string()
const;
147 bool is_constructed_;
151 std::string comp_dir_path_;
152 std::string abs_path_;
155 mutable vector<type_base_sptr> synthesized_types_;
156 vector<function_type_sptr> live_fn_types_;
165 language_(LANG_UNKNOWN)
182 size_t alignment_in_bits;
202 unordered_set<uintptr_t> depends_on_recursive_type_;
203 bool canonical_type_propagated_;
204 bool propagated_canonical_type_confirmed_;
209 naked_canonical_type(),
210 canonical_type_propagated_(
false),
211 propagated_canonical_type_confirmed_(
false)
216 type_base_sptr c = type_base_sptr())
218 alignment_in_bits(a),
220 naked_canonical_type(c.get()),
221 canonical_type_propagated_(
false),
222 propagated_canonical_type_confirmed_(
false)
236 {
return !depends_on_recursive_type_.empty();}
255 (depends_on_recursive_type_.find(
reinterpret_cast<uintptr_t
>(dependant))
256 != depends_on_recursive_type_.end());
271 {depends_on_recursive_type_.insert(
reinterpret_cast<uintptr_t
>(t));}
286 {depends_on_recursive_type_.erase(
reinterpret_cast<uintptr_t
>(t));}
291 {depends_on_recursive_type_.clear();}
301 {
return canonical_type_propagated_;}
311 {canonical_type_propagated_ = f;}
324 {
return propagated_canonical_type_confirmed_;}
337 {propagated_canonical_type_confirmed_ = f;}
344 if (canonical_type_propagated_ && !propagated_canonical_type_confirmed_)
346 canonical_type.reset();
347 naked_canonical_type =
nullptr;
365 {
return abigail::hashing::combine_hashes(p.first, p.second);}
393 mutable vector<type_base_sptr> sorted_canonical_types_;
394 type_base_sptr void_type_;
395 type_base_sptr void_pointer_type_;
396 type_base_sptr variadic_marker_type_;
413 vector<type_base_sptr> extra_live_types_;
456 vector<const type_base*> left_type_comp_operands_;
457 vector<const type_base*> right_type_comp_operands_;
463 pointer_set types_with_non_confirmed_propagated_ct_;
465#ifdef WITH_DEBUG_CT_PROPAGATION
471 mutable pointer_set types_with_cleared_propagated_ct_;
473#ifdef WITH_DEBUG_SELF_COMPARISON
488 unordered_map<string, uintptr_t> type_id_canonical_type_map_;
491 unordered_map<uintptr_t, string> pointer_type_id_map_;
493 bool canonicalization_is_done_;
494 bool do_on_the_fly_canonicalization_;
495 bool decl_only_class_equals_definition_;
496 bool use_enum_binary_only_equality_;
497 bool allow_type_comparison_results_caching_;
500#ifdef WITH_DEBUG_SELF_COMPARISON
501 bool self_comparison_debug_on_;
503#ifdef WITH_DEBUG_TYPE_CANONICALIZATION
508 bool use_canonical_type_comparison_;
516 bool debug_type_canonicalization_;
517 bool debug_die_canonicalization_;
521 : canonicalization_is_done_(),
522 do_on_the_fly_canonicalization_(
true),
523 decl_only_class_equals_definition_(
false),
524 use_enum_binary_only_equality_(
true),
525 allow_type_comparison_results_caching_(
false),
527#ifdef WITH_DEBUG_SELF_COMPARISON
529 self_comparison_debug_on_(
false)
531#ifdef WITH_DEBUG_TYPE_CANONICALIZATION
533 use_canonical_type_comparison_(
true),
534 debug_type_canonicalization_(
false),
535 debug_die_canonicalization_(
false)
546 {allow_type_comparison_results_caching_ = f;}
557 {
return allow_type_comparison_results_caching_;}
587 && !
is_type(&first)->priv_->depends_on_recursive_type()
588 && !
is_type(&second)->priv_->depends_on_recursive_type())))
590 type_comparison_results_cache_.emplace
591 (std::make_pair(
reinterpret_cast<uint64_t
>(&first),
592 reinterpret_cast<uint64_t
>(&second)),
623 type_comparison_result_type::const_iterator it =
624 type_comparison_results_cache_.find
625 (std::make_pair(
reinterpret_cast<uint64_t
>(&first),
626 reinterpret_cast<uint64_t
>(&second)));
627 if (it == type_comparison_results_cache_.end())
637 {type_comparison_results_cache_.clear();}
654 left_type_comp_operands_.push_back(left);
655 right_type_comp_operands_.push_back(right);
675 const type_base *t = left_type_comp_operands_.back();
677 t = right_type_comp_operands_.back();
680 left_type_comp_operands_.pop_back();
681 right_type_comp_operands_.pop_back();
698 vector<const type_base*>& types)
704 && (
reinterpret_cast<uintptr_t
>(t)
705 ==
reinterpret_cast<uintptr_t
>(type)))
711 t->priv_->set_depends_on_recursive_type(type);
778 right_type_comp_operands_);
779 recursive_types_.insert(
reinterpret_cast<uintptr_t
>(right));
791 return (recursive_types_.find(
reinterpret_cast<uintptr_t
>(t))
792 != recursive_types_.end());
801 {recursive_types_.erase(
reinterpret_cast<uintptr_t
>(t));}
816 dest.priv_->canonical_type = canonical;
817 dest.priv_->naked_canonical_type = canonical.get();
819#ifdef WITH_DEBUG_CT_PROPAGATION
822 erase_type_with_cleared_propagated_canonical_type(&dest);
839 for (
auto i : types_with_non_confirmed_propagated_ct_)
847#ifdef WITH_DEBUG_SELF_COMPARISON
848 check_abixml_canonical_type_propagation_during_self_comp(t);
853 for (
auto i : to_remove)
854 types_with_non_confirmed_propagated_ct_.erase(i);
876 env.priv_->confirm_ct_propagation_for_types_dependant_on(t);
878 env.priv_->remove_from_types_with_non_confirmed_propagated_ct(t);
879 env.priv_->set_is_not_recursive(t);
881#ifdef WITH_DEBUG_SELF_COMPARISON
882 check_abixml_canonical_type_propagation_during_self_comp(t);
897 for (
auto i : types_with_non_confirmed_propagated_ct_)
902#ifdef WITH_DEBUG_SELF_COMPARISON
903 check_abixml_canonical_type_propagation_during_self_comp(t);
906 types_with_non_confirmed_propagated_ct_.clear();
909#ifdef WITH_DEBUG_CT_PROPAGATION
919 types_with_cleared_propagated_ct()
const
920 {
return types_with_cleared_propagated_ct_;}
931 types_with_cleared_propagated_ct()
932 {
return types_with_cleared_propagated_ct_;}
939 record_type_with_cleared_propagated_canonical_type(
const type_base* t)
941 uintptr_t ptr =
reinterpret_cast<uintptr_t
>(t);
942 types_with_cleared_propagated_ct_.insert(ptr);
952 erase_type_with_cleared_propagated_canonical_type(
const type_base* t)
954 uintptr_t ptr =
reinterpret_cast<uintptr_t
>(t);
955 types_with_cleared_propagated_ct_.erase(ptr);
977 for (
const auto i : types)
981 if (collected.find(i) != collected.end())
1015 types_with_non_confirmed_propagated_ct_,
1018 for (
auto i : to_remove)
1023 type_base_sptr canonical = t->priv_->canonical_type.lock();
1031 for (
auto i : to_remove)
1032 types_with_non_confirmed_propagated_ct_.erase(i);
1059 env.priv_->cancel_ct_propagation_for_types_dependant_on(t);
1066 env.priv_->remove_from_types_with_non_confirmed_propagated_ct(t);
1067 env.priv_->clear_type_comparison_results_cache();
1085#ifdef WITH_DEBUG_CT_PROPAGATION
1088 record_type_with_cleared_propagated_canonical_type(t)
1102 uintptr_t v =
reinterpret_cast<uintptr_t
>(t);
1103 types_with_non_confirmed_propagated_ct_.insert(v);
1114 uintptr_t i =
reinterpret_cast<uintptr_t
>(dependant);
1115 types_with_non_confirmed_propagated_ct_.erase(i);
1123 vector<uintptr_t> to_erase;
1124 for (
auto i : types_with_non_confirmed_propagated_ct_)
1125 to_erase.push_back(i);
1127 for (
auto i : to_erase)
1134#ifdef WITH_DEBUG_SELF_COMPARISON
1136 const unordered_map<string, uintptr_t>&
1137 get_type_id_canonical_type_map()
const
1138 {
return type_id_canonical_type_map_;}
1140 unordered_map<string, uintptr_t>&
1141 get_type_id_canonical_type_map()
1142 {
return type_id_canonical_type_map_;}
1144 const unordered_map<uintptr_t, string>&
1145 get_pointer_type_id_map()
const
1146 {
return pointer_type_id_map_;}
1148 unordered_map<uintptr_t, string>&
1149 get_pointer_type_id_map()
1150 {
return pointer_type_id_map_;}
1153 get_type_id_from_pointer(uintptr_t ptr)
const
1155 auto it = get_pointer_type_id_map().find(ptr);
1156 if (it != get_pointer_type_id_map().end())
1162 get_type_id_from_type(
const type_base *t)
const
1163 {
return get_type_id_from_pointer(
reinterpret_cast<uintptr_t
>(t));}
1166 get_canonical_type_from_type_id(
const char* type_id)
const
1170 auto it = get_type_id_canonical_type_map().find(type_id);
1171 if (it != get_type_id_canonical_type_map().end())
1189 check_canonical_type_from_abixml_during_self_comp(
const type_base* t,
1192 if (!t || !t->get_corpus() || !c)
1195 if (!(t->get_corpus()->get_origin() == ir::corpus::NATIVE_XML_ORIGIN))
1201 unordered_map<uintptr_t, string>::const_iterator it =
1202 pointer_type_id_map_.find(
reinterpret_cast<uintptr_t
>(t));
1203 if (it == pointer_type_id_map_.end())
1207 type_id = it->second;
1212 type_base *original_canonical_type =
nullptr;
1213 if (!type_id.empty())
1215 unordered_map<string, uintptr_t>::const_iterator it =
1216 type_id_canonical_type_map_.find(type_id);
1217 if (it == type_id_canonical_type_map_.end())
1219 original_canonical_type =
reinterpret_cast<type_base*
>(it->second);
1228 if (original_canonical_type == c)
1244 check_abixml_canonical_type_propagation_during_self_comp(
const type_base* t)
1247 && t->get_corpus()->get_origin() == ir::corpus::NATIVE_XML_ORIGIN)
1249 type_base* c = t->get_naked_canonical_type();
1250 if (c && !check_canonical_type_from_abixml_during_self_comp(t, c))
1252 string repr = t->get_pretty_representation(
true,
true);
1253 string type_id = get_type_id_from_type(t);
1254 std::cerr <<
"error: canonical type propagation error for '"
1256 <<
"' of type-id: '"
1263 <<
", should have had canonical type: "
1265 << get_canonical_type_from_type_id(type_id.c_str())
1285 check_canonical_type_from_abixml_during_self_comp(
const type_base_sptr& t,
1286 const type_base_sptr& c)
1288 return check_canonical_type_from_abixml_during_self_comp(t.get(), c.get());
1295 const decl_base *s);
1347 else if (!!fl != !!sl)
1373 const decl_base_sptr &s)
1421 const type_base_sptr &s)
1435 if (f == s || !f || !s)
1444 == corpus::NATIVE_XML_ORIGIN))))
1450 if (f_is_ptr_ref_or_qual != s_is_ptr_ref_or_qual)
1451 return !f_is_ptr_ref_or_qual && s_is_ptr_ref_or_qual;
1453 if (f_is_ptr_ref_or_qual && s_is_ptr_ref_or_qual
1463 if (q->get_cv_quals() == qualified_type_def::CV_NONE)
1548 if (m_f->get_is_const() != m_s->get_is_const())
1549 return m_f->get_is_const();
1553 if (m_f->get_is_for_static_method() != m_s->get_is_for_static_method())
1554 return m_f->get_is_for_static_method() < m_s->get_is_for_static_method();
1572 return decl_comp(fd, sd);
1607template<
typename input_iterator,
1608 typename deref_lambda>
1611 const input_iterator& end,
1618 std::stable_sort(begin, end, comp);
1623 for (t = begin,i = 0; t != end; ++t, ++i)
1625 if (deref(t)->get_environment().priv_->do_log())
1626 std::cerr <<
"#" << std::dec << i <<
" ";
1631#ifdef WITH_DEBUG_CT_PROPAGATION
1636 const environment& env = deref(begin)->get_environment();
1638 env.priv_->types_with_cleared_propagated_ct();
1656 member_function_templates member_function_templates_;
1657 member_class_templates member_class_templates_;
1664 : data_members_(data_mbrs),
1665 member_functions_(mbr_fns)
1667 for (data_members::const_iterator i = data_members_.begin();
1668 i != data_members_.end();
1671 non_static_data_members_.push_back(*i);
1694 env.priv_->left_classes_being_compared_.insert(&first);
1695 env.priv_->right_classes_being_compared_.insert(&second);
1733 const class_or_union_sptr& second)
const
1756 env.priv_->left_classes_being_compared_.erase(&first);
1757 env.priv_->right_classes_being_compared_.erase(&second);
1778 if (!first || !second)
1797 return (env.priv_->left_classes_being_compared_.count(&first)
1798 || env.priv_->right_classes_being_compared_.count(&second)
1799 || env.priv_->right_classes_being_compared_.count(&first)
1800 || env.priv_->left_classes_being_compared_.count(&second));
1815 if (first && second)
1836 type_base_sptr return_type)
1838 return_type_(return_type)
1841 priv(type_base_sptr return_type)
1842 : return_type_(return_type)
1858 env.priv_->left_fn_types_being_compared_.insert(&first);
1859 env.priv_->right_fn_types_being_compared_.insert(&second);
1875 env.priv_->left_fn_types_being_compared_.erase(&first);
1876 env.priv_->right_fn_types_being_compared_.erase(&second);
1890 return (env.priv_->left_fn_types_being_compared_.count(&first)
1892 env.priv_->right_fn_types_being_compared_.count(&second));
#define ABG_ASSERT(cond)
This is a wrapper around the 'assert' glibc call. It allows for its argument to have side effects,...
Types of the main internal representation of libabigail.
Simplified implementation of std::optional just enough to be used as a replacement for our purposes a...
This type abstracts the configuration information of the library.
The interned string pool.
The abstraction of an interned string.
The base type of class_decl and union_decl.
vector< method_decl_sptr > member_functions
Convenience typedef.
unordered_map< string, method_decl * > string_mem_fn_ptr_map_type
Convenience typedef.
vector< var_decl_sptr > data_members
Convenience typedef.
unordered_map< string, method_decl_sptr > string_mem_fn_sptr_map_type
Convenience typedef.
This is the abstraction of a set of translation units (themselves seen as bundles of unitary abi arte...
origin get_origin() const
Getter for the origin of the corpus.
The base type of all declarations.
friend bool get_member_is_static(const decl_base &d)
Gets a flag saying if a class member is static or not.
const interned_string & get_name() const
Getter for the name of the current decl.
bool get_is_anonymous() const
Test if the current declaration is anonymous.
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
std::unordered_map< string, std::vector< type_base_sptr > > canonical_types_map_type
A convenience typedef for a map of canonical types. The key is the pretty representation string of a ...
Abstraction of a function type.
std::vector< parameter_sptr > parameters
Convenience typedef for a vector of parameter_sptr.
The internal representation of an integral type.
void set_modifiers(modifiers_type)
Setter of the modifiers bitmap of the integral_type.
string to_string(bool internal=false) const
Return the string representation of the current instance of integral_type.
base_type get_base_type() const
Getter of the base type of the integral_type.
modifiers_type
The modifiers of the base types above. Several modifiers can be combined for a given base type....
@ LONG_LONG_MODIFIER
The "long long" modifier.
@ LONG_MODIFIER
The "long" modifier.
@ SIGNED_MODIFIER
The "signed" modifier.
@ UNSIGNED_MODIFIER
The "unsigned" modier.
@ SHORT_MODIFIER
The "short" modifier.
bool operator==(const integral_type &) const
Equality operator for the integral_type.
base_type
The possible base types of integral types. We might have forgotten many of these, so do not hesitate ...
@ WCHAR_T_BASE_TYPE
The "wchar_t" base type.
@ CHAR32_T_BASE_TYPE
The "char32_t" base type.
@ FLOAT_BASE_TYPE
The "float" base type.
@ BOOL_BASE_TYPE
The "bool" base type in C++ or "_Bool" in C11.
@ CHAR_BASE_TYPE
The "char" base type.
@ CHAR16_T_BASE_TYPE
The "char16_t base type.
@ INT_BASE_TYPE
The "int" base type.
@ DOUBLE_BASE_TYPE
The "double" base type.
modifiers_type get_modifiers() const
Getter of the modifiers bitmap of the integral_type.
integral_type()
Default constructor of the integral_type.
The entry point to manage locations.
The source location of a token.
unsigned get_value() const
Get the value of the location.
Abstracts the type of a class member function.
The abstraction of a qualified type.
language
The language of the translation unit.
shared_ptr< scope_decl > global_scope_sptr
Convenience typedef for a shared pointer on a global_scope.
An abstraction helper for type declarations.
type_base_sptr get_canonical_type() const
Getter of the canonical type of the current instance of type_base.
This is a type that aggregates maps of all the kinds of types that are supported by libabigail.
const corpus * get_corpus() const
Get the corpus this ABI artifact belongs to.
const environment & get_environment() const
Getter of the environment of the current ABI artifact.
weak_ptr< typedef_decl > typedef_decl_wptr
Convenience typedef for a weak pointer on a typedef_decl.
unordered_map< uint64_t_pair_type, bool, uint64_t_pair_hash > type_comparison_result_type
A convenience typedef for a map which key is a pair of uint64_t and which value is a boolean....
corpus::origin operator|=(corpus::origin &l, corpus::origin r)
Bitwise |= operator for the corpus::origin type.
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
weak_ptr< type_base > type_base_wptr
Convenience typedef for a weak pointer on a type_base.
unordered_set< const class_or_union * > class_set_type
A convenience typedef for a set of pointer to class_or_union.
integral_type::modifiers_type operator~(integral_type::modifiers_type l)
Bitwise one's complement operator for integral_type::modifiers_type.
unordered_set< const function_type * > fn_set_type
A convenience typedef for a set of pointer to function_type.
comparison_result
The result of structural comparison of type ABI artifacts.
string get_pretty_representation(const type_or_decl_base *tod, bool internal)
Build and return a copy of the pretty representation of an ABI artifact that could be either a type o...
type_base_sptr peel_typedef_pointer_or_reference_type(const type_base_sptr type)
Return the leaf underlying or pointed-to type node of a typedef_decl, pointer_type_def,...
void canonicalize_types(const input_iterator &begin, const input_iterator &end, deref_lambda deref)
Compute the canonical type for all the IR types of the system.
typedef_decl_sptr is_typedef(const type_or_decl_base_sptr t)
Test whether a type is a typedef.
weak_ptr< corpus > corpus_wptr
Convenience typedef for a weak pointer to a corpus.
type_base * peel_pointer_or_reference_type(const type_base *type, bool peel_qual_type)
Return the leaf underlying or pointed-to type node of a, pointer_type_def, reference_type_def or qual...
corpus::origin operator|(corpus::origin l, corpus::origin r)
Bitwise | operator for the corpus::origin type.
bool parse_integral_type(const string &type_name, integral_type &type)
Parse an integral type from a string.
corpus::origin operator&(corpus::origin l, corpus::origin r)
Bitwise & operator for the corpus::origin type.
type_base_sptr canonicalize(type_base_sptr t)
Compute the canonical type of a given type.
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
unordered_set< uintptr_t > pointer_set
A convenience typedef for an unordered set of pointer values.
const location & get_artificial_or_natural_location(const decl_base *decl)
Get the artificial location of a decl.
bool compare_using_locations(const decl_base *f, const decl_base *s)
Compare decls using their locations.
bool is_unique_type(const type_base_sptr &t)
Test if a type is unique in the entire environment.
unordered_set< uint64_t_pair_type, uint64_t_pair_hash > uint64_t_pairs_set_type
A convenience typedef for a set of uint64_t_pair.
corpus::origin operator&=(corpus::origin &l, corpus::origin r)
Bitwise &= operator for the corpus::origin type.
method_type_sptr is_method_type(const type_or_decl_base_sptr &t)
Test whether a type is a method_type.
qualified_type_def * is_qualified_type(const type_or_decl_base *t)
Test whether a type is a reference_type_def.
bool is_ptr_ref_or_qual_type(const type_base *t)
Helper to detect if a type is either a reference, a pointer, or a qualified type.
std::pair< uint64_t, uint64_t > uint64_t_pair_type
A convenience typedef for a pair of uint64_t which is initially intended to store a pair of pointer v...
Toplevel namespace for libabigail.
bool comparison_started(const class_or_union &first, const class_or_union &second) const
Test if a pair of class_or_union is being currently compared.
bool comparison_started(const class_or_union *first, const class_or_union *second) const
Test if a pair of class_or_union is being currently compared.
void mark_as_being_compared(const class_or_union_sptr &first, const class_or_union_sptr &second) const
Mark a pair of classes or unions as being currently compared using the class_or_union== operator.
void mark_as_being_compared(const class_or_union &first, const class_or_union &second) const
Mark a pair of classes or unions as being currently compared using the class_or_union== operator.
void mark_as_being_compared(const class_or_union *first, const class_or_union *second) const
Mark a pair of classes or unions as being currently compared using the class_or_union== operator.
void unmark_as_being_compared(const class_or_union *first, const class_or_union *second) const
If a pair of class_or_union has been previously marked as being compared – via an invocation of mark_...
void unmark_as_being_compared(const class_or_union &first, const class_or_union &second) const
If a pair of class_or_union has been previously marked as being compared – via an invocation of mark_...
A functor to sort decls somewhat topologically. That is, types are sorted in a way that makes the one...
bool operator()(const decl_base *f, const decl_base *s)
The "Less Than" comparison operator of this functor.
bool operator()(const decl_base_sptr &f, const decl_base_sptr &s)
The "Less Than" comparison operator of this functor.
The private data of the environment type.
void confirm_ct_propagation()
Mark all the types that have been the target of canonical type propagation and that are not yet confi...
bool is_type_comparison_cached(T &first, T &second, bool &r)
Retrieve the result of comparing two sub-types from the cache, if it was previously stored.
bool collect_types_that_depends_on(const type_base *target, const pointer_set &types, pointer_set &collected)
Collect the types that depends on a given "target" type.
void confirm_ct_propagation_for_types_dependant_on(const type_base *dependant_type)
Mark a set of types that have been the target of canonical type propagation and that depend on a recu...
void set_is_not_recursive(const type_base *t)
Unflag a type as being recursive.
void clear_type_comparison_results_cache()
Clear the cache type comparison results.
void push_composite_type_comparison_operands(const type_base *left, const type_base *right)
Push a pair of operands on the stack of operands of the current type comparison, during type canonica...
void remove_from_types_with_non_confirmed_propagated_ct(const type_base *dependant)
Remove a given type from the set of types that have been non-confirmed subjects of the canonical type...
void confirm_ct_propagation(const type_base *t)
Mark a type that has been the target of canonical type propagation as being permanently canonicalized...
void add_to_types_with_non_confirmed_propagated_ct(const type_base *t)
Add a given type to the set of types that have been non-confirmed subjects of the canonical type prop...
bool mark_dependant_types_compared_until(const type_base *right)
In the stack of the current types being compared (as part of type canonicalization),...
void cancel_all_non_confirmed_propagated_canonical_types()
Cancel the propagated canonical types of all the types which propagated canonical type have not yet b...
void cancel_ct_propagation_for_types_dependant_on(const type_base *target)
Reset the canonical type (set it nullptr) of a set of types that have been the target of canonical ty...
void clear_propagated_canonical_type(const type_base *t)
Clear the propagated canonical type of a given type.
void pop_composite_type_comparison_operands(const type_base *left, const type_base *right)
Pop a pair of operands from the stack of operands to the current type comparison.
void allow_type_comparison_results_caching(bool f)
Allow caching of the sub-types comparison results during the invocation of the equal overloads for cl...
bool allow_type_comparison_results_caching() const
Check whether if caching of the sub-types comparison results during the invocation of the equal overl...
bool mark_dependant_types(const type_base *type, vector< const type_base * > &types)
Mark all the types that comes after a certain one as NOT being eligible for the canonical type propag...
bool propagate_ct(const type_base &src, const type_base &dest)
Propagate the canonical type of a type to another one.
void cache_type_comparison_result(T &first, T &second, bool r)
Cache the result of comparing two sub-types.
void cancel_ct_propagation(const type_base *t)
Reset the canonical type (set it nullptr) of a type that has been the target of canonical type propag...
bool is_recursive_type(const type_base *t)
Test if a type is a recursive one.
The type of the private data of the function_type type.
void mark_as_being_compared(const function_type &first, const function_type &second) const
Mark a given pair of function_type as being compared.
bool comparison_started(const function_type &first, const function_type &second) const
Tests if a function_type is currently being compared.
void unmark_as_being_compared(const function_type &first, const function_type &second) const
Mark a given pair of function_type as being compared.
Private type to hold private members of translation_unit.
Definition of the private data of type_base.
void set_does_not_depend_on_recursive_type(const type_base *t)
Unset the flag that tells if the current type depends on a given recursive type.
void set_propagated_canonical_type_confirmed(bool f)
Setter of the property propagated-canonical-type-confirmed.
void set_does_not_depend_on_recursive_type()
Flag the current type as not being dependant on any recursive type.
bool depends_on_recursive_type(const type_base *dependant) const
Test if the current type depends on a given recursive type.
bool propagated_canonical_type_confirmed() const
Getter of the property propagated-canonical-type-confirmed.
void set_depends_on_recursive_type(const type_base *t)
Set the flag that tells if the current type depends on a given recursive type.
bool canonical_type_propagated()
Test if the type carries a canonical type that is the result of maybe_propagate_canonical_type(),...
bool clear_propagated_canonical_type()
If the current canonical type was set as the result of the "canonical type propagation optimization",...
void set_canonical_type_propagated(bool f)
Set the flag that says if the type carries a canonical type that is the result of maybe_propagate_can...
bool depends_on_recursive_type() const
Test if the current type depends on recursive type comparison.
A functor to sort types somewhat topologically. That is, types are sorted in a way that makes the one...
bool has_artificial_or_natural_location(const type_base *t)
Test if a type has an artificial or natural location.
bool has_artificial_or_natural_location(const decl_base *d)
Test if a decl has an artificial or natural location.
bool operator()(const type_base_sptr &f, const type_base_sptr &s)
The "Less Than" comparison operator of this functor.
bool operator()(const type_base *f, const type_base *s)
The "Less Than" comparison operator of this functor.
The hashing functor for a pair of uint64_t.
uint64_t operator()(const std::pair< uint64_t, uint64_t > &p) const
Hashing function for a pair of uint64_t.