libabigail
Public Member Functions | Public Attributes | List of all members
environment::priv Struct Reference

The private data of the environment type. More...

#include <abg-ir-priv.h>

Public Member Functions

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 propagation optimization. More...
 
bool allow_type_comparison_results_caching () const
 Check whether if caching of the sub-types comparison results during the invocation of the equal overloads for class and function types is in effect. More...
 
void allow_type_comparison_results_caching (bool f)
 Allow caching of the sub-types comparison results during the invocation of the equal overloads for class and function types. More...
 
template<typename T >
void cache_type_comparison_result (T &first, T &second, bool r)
 Cache the result of comparing two sub-types. More...
 
void cancel_all_non_confirmed_propagated_canonical_types ()
 Cancel the propagated canonical types of all the types which propagated canonical type have not yet been confirmed. More...
 
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 propagation. More...
 
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 type propagation and that depend on a given recursive type. More...
 
void clear_propagated_canonical_type (const type_base *t)
 Clear the propagated canonical type of a given type. More...
 
void clear_type_comparison_results_cache ()
 Clear the cache type comparison results. More...
 
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. More...
 
void confirm_ct_propagation ()
 Mark all the types that have been the target of canonical type propagation and that are not yet confirmed as being permanently canonicalized (aka confirmed). More...
 
void confirm_ct_propagation (const type_base *t)
 Mark a type that has been the target of canonical type propagation as being permanently canonicalized. More...
 
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 recursive type as being permanently canonicalized. More...
 
bool do_log () const
 
void do_log (bool f)
 
bool is_recursive_type (const type_base *t)
 Test if a type is a recursive one. More...
 
template<typename T >
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. More...
 
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 propagation optimization. More...
 
bool mark_dependant_types_compared_until (const type_base *right)
 In the stack of the current types being compared (as part of type canonicalization), mark all the types that comes after a certain one as NOT being eligible to the canonical type propagation optimization. More...
 
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. More...
 
bool propagate_ct (const type_base &src, const type_base &dest)
 Propagate the canonical type of a type to another one. More...
 
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 canonicalization. More...
 
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 propagation optimization. More...
 
void set_is_not_recursive (const type_base *t)
 Unflag a type as being recursive. More...
 

Public Attributes

bool allow_type_comparison_results_caching_
 
optional< bool > analyze_exported_interfaces_only_
 
canonical_types_map_type canonical_types_
 
bool canonicalization_is_done_
 
config config_
 
bool decl_only_class_equals_definition_
 
bool do_log_
 
bool do_on_the_fly_canonicalization_
 
vector< type_base_sptr > extra_live_types_
 
class_set_type left_classes_being_compared_
 
fn_set_type left_fn_types_being_compared_
 
vector< const type_base * > left_type_comp_operands_
 
pointer_set recursive_types_
 
class_set_type right_classes_being_compared_
 
fn_set_type right_fn_types_being_compared_
 
vector< const type_base * > right_type_comp_operands_
 
vector< type_base_sptr > sorted_canonical_types_
 
interned_string_pool string_pool_
 
type_comparison_result_type type_comparison_results_cache_
 
pointer_set types_with_non_confirmed_propagated_ct_
 
bool use_enum_binary_only_equality_
 
type_base_sptr variadic_marker_type_
 
type_base_sptr void_pointer_type_
 
type_base_sptr void_type_
 

Detailed Description

The private data of the environment type.

Definition at line 388 of file abg-ir-priv.h.

Member Function Documentation

◆ add_to_types_with_non_confirmed_propagated_ct()

void add_to_types_with_non_confirmed_propagated_ct ( const type_base t)
inline

Add a given type to the set of types that have been non-confirmed subjects of the canonical type propagation optimization.

Parameters
tthe dependant type to consider.

Definition at line 1099 of file abg-ir-priv.h.

◆ allow_type_comparison_results_caching() [1/2]

bool allow_type_comparison_results_caching ( ) const
inline

Check whether if caching of the sub-types comparison results during the invocation of the equal overloads for class and function types is in effect.

Returns
true iff caching of the sub-types comparison results during the invocation of the equal overloads for class and function types is in effect.

Definition at line 555 of file abg-ir-priv.h.

◆ allow_type_comparison_results_caching() [2/2]

void allow_type_comparison_results_caching ( bool  f)
inline

Allow caching of the sub-types comparison results during the invocation of the equal overloads for class and function types.

Parameters
fif true, allow type comparison result caching.

Definition at line 544 of file abg-ir-priv.h.

◆ cache_type_comparison_result()

void cache_type_comparison_result ( T &  first,
T &  second,
bool  r 
)
inline

Cache the result of comparing two sub-types.

Parameters
firstthe first sub-type that has been compared. Its address is going to be stored in the cache.
secondthe second sub-type that has been compared. Its address is going to be stored in the cache.
rthe result of comparing first and second. This is going to be stored in the cache, as well as the addresses of first and second.

Definition at line 579 of file abg-ir-priv.h.

◆ cancel_all_non_confirmed_propagated_canonical_types()

void cancel_all_non_confirmed_propagated_canonical_types ( )
inline

Cancel the propagated canonical types of all the types which propagated canonical type have not yet been confirmed.

Definition at line 1120 of file abg-ir-priv.h.

◆ cancel_ct_propagation()

void cancel_ct_propagation ( const type_base t)
inline

Reset the canonical type (set it nullptr) of a type that has been the target of canonical type propagation.

This also resets the propagated canonical type of the set of types that depends on a given recursive type.

Once the canonical type of a type in that set is reset, the type is marked as being non-dependant on a recursive type anymore.

To understand the sentences above, please read the description of type canonicalization and especially about the "canonical type propagation optimization" at On-the-fly Canonicalization, in the src/abg-ir.cc file.

Parameters
targetif a type which has been subject to the canonical type propagation optimizationdepends on a this target type, then cancel its canonical type.

Definition at line 1052 of file abg-ir-priv.h.

◆ cancel_ct_propagation_for_types_dependant_on()

void cancel_ct_propagation_for_types_dependant_on ( const type_base target)
inline

Reset the canonical type (set it nullptr) of a set of types that have been the target of canonical type propagation and that depend on a given recursive type.

Once the canonical type of a type in that set is reset, the type is marked as being non-dependant on a recursive type anymore.

To understand the sentences above, please read the description of type canonicalization and especially about the "canonical type propagation optimization" at On-the-fly Canonicalization, in the src/abg-ir.cc file.

Parameters
targetif a type which has been subject to the canonical type propagation optimizationdepends on a this target type, then cancel its canonical type.

Definition at line 1010 of file abg-ir-priv.h.

◆ clear_propagated_canonical_type()

void clear_propagated_canonical_type ( const type_base t)
inline

Clear the propagated canonical type of a given type.

This function also updates the book-keeping of the set of types which propagated canonical types have been cleared.

Please note that at the end of the canonicalization of all the types in the system, all the types which propagated canonical type has been cleared must be canonicalized.

Parameters
tthe type to

Definition at line 1080 of file abg-ir-priv.h.

◆ clear_type_comparison_results_cache()

void clear_type_comparison_results_cache ( )
inline

Clear the cache type comparison results.

Definition at line 635 of file abg-ir-priv.h.

◆ collect_types_that_depends_on()

bool collect_types_that_depends_on ( const type_base target,
const pointer_set types,
pointer_set collected 
)
inline

Collect the types that depends on a given "target" type.

Walk a set of types and if they depend directly or indirectly on a "target" type, then collect them into a set.

Parameters
targetthe target type to consider.
typesthe types to walk to detect those who depend on target.
Returns
true iff one or more type from types is found to depend on target.

Definition at line 971 of file abg-ir-priv.h.

◆ confirm_ct_propagation() [1/2]

void confirm_ct_propagation ( )
inline

Mark all the types that have been the target of canonical type propagation and that are not yet confirmed as being permanently canonicalized (aka confirmed).

To understand the sentence above, please read the description of type canonicalization and especially about the "canonical type propagation optimization" at On-the-fly Canonicalization, in the src/abg-ir.cc file.

Definition at line 894 of file abg-ir-priv.h.

◆ confirm_ct_propagation() [2/2]

void confirm_ct_propagation ( const type_base t)
inline

Mark a type that has been the target of canonical type propagation as being permanently canonicalized.

This function also marks the set of types that have been the target of canonical type propagation and that depend on a recursive type as being permanently canonicalized.

To understand the sentence above, please read the description of type canonicalization and especially about the "canonical type propagation optimization" at On-the-fly Canonicalization, in the src/abg-ir.cc file.

Definition at line 868 of file abg-ir-priv.h.

◆ confirm_ct_propagation_for_types_dependant_on()

void confirm_ct_propagation_for_types_dependant_on ( const type_base dependant_type)
inline

Mark a set of types that have been the target of canonical type propagation and that depend on a recursive type as being permanently canonicalized.

To understand the sentence above, please read the description of type canonicalization and especially about the "canonical type propagation optimization" at On-the-fly Canonicalization, in the src/abg-ir.cc file.

Definition at line 835 of file abg-ir-priv.h.

◆ is_recursive_type()

bool is_recursive_type ( const type_base t)
inline

Test if a type is a recursive one.

Parameters
tthe type to consider.
Returns
true iff t is recursive.

Definition at line 788 of file abg-ir-priv.h.

◆ is_type_comparison_cached()

bool is_type_comparison_cached ( T &  first,
T &  second,
bool &  r 
)
inline

Retrieve the result of comparing two sub-types from the cache, if it was previously stored.

Parameters
firstthe first sub-type to consider.
secondthe second sub-type to consider. The pair of addresses of {first, second} is going to be looked up in the cache. If it's present, then the associated result of the comparison of first against second is present as well, and is returned.
rthis is an out parameter which is set to the result of the comparison of first against second if the pair of addresses of {first, second} is present in the cache.
Returns
true iff the pair of addresses of {first, second} is present in the cache. In that case, the associated result of the comparison of first against second is returned in the argument of r.

Definition at line 617 of file abg-ir-priv.h.

◆ mark_dependant_types()

bool mark_dependant_types ( const type_base type,
vector< const type_base * > &  types 
)
inline

Mark all the types that comes after a certain one as NOT being eligible for the canonical type propagation optimization.

Parameters
typethe type that represents the "marker type". All types after this one will be marked as being NON-eligible to the canonical type propagation optimization.
typesthe set of types to consider. In that vector, all types that come after type are going to be marked as being non-eligible to the canonical type propagation optimization.
Returns
true iff the operation was successful.

Definition at line 696 of file abg-ir-priv.h.

◆ mark_dependant_types_compared_until()

bool mark_dependant_types_compared_until ( const type_base right)
inline

In the stack of the current types being compared (as part of type canonicalization), mark all the types that comes after a certain one as NOT being eligible to the canonical type propagation optimization.

For a starter, please read about the On-the-fly Canonicalization, aka, "canonical type propagation optimization".

To implement that optimization, we need, among other things to maintain stack of the types (and their sub-types) being currently compared as part of type canonicalization.

Note that we only consider the type that is the right-hand-side operand of the comparison because it's that one that is being canonicalized and thus, that is not yet canonicalized.

The reason why a type is deemed NON-eligible to the canonical type propagation optimization is that it "depends" on recursively present type. Let me explain.

Suppose we have a type T that has sub-types named ST0 and ST1. Suppose ST1 itself has a sub-type that is T itself. In this case, we say that T is a recursive type, because it has T (itself) as one of its sub-types:

T +– ST0 | +– ST1 + | +– T

ST1 is said to "depend" on T because it has T as a sub-type. But because T is recursive, then ST1 is said to depend on a recursive type. Notice however that ST0 does not depend on any recursive type.

When we are at the point of comparing the sub-type T of ST1 against its counterpart, the stack of the right-hand-side operands of the type canonicalization is going to look like this:

| T | ST1 |

We don't add the type T to the stack as we detect that T was already in there (recursive cycle).

So, this function will basically mark ST1 as being NON-eligible to being the target of canonical type propagation.

Parameters
rightthe right-hand-side operand of the type comparison.
Returns
true iff the operation was successful.

Definition at line 771 of file abg-ir-priv.h.

◆ pop_composite_type_comparison_operands()

void pop_composite_type_comparison_operands ( const type_base left,
const type_base right 
)
inline

Pop a pair of operands from the stack of operands to the current type comparison.

For more information on this, please look at the description of the right_type_comp_operands_ data member.

Parameters
leftthe left-hand-side comparison operand we expect to pop from the top of the stack. If this doesn't match the operand found on the top of the stack, the function aborts.
rightthe right-hand-side comparison operand we expect to pop from the bottom of the stack. If this doesn't match the operand found on the top of the stack, the function aborts.

Definition at line 671 of file abg-ir-priv.h.

◆ propagate_ct()

bool propagate_ct ( const type_base src,
const type_base dest 
)
inline

Propagate the canonical type of a type to another one.

Parameters
srcthe type to propagate the canonical type from.
destthe type to propagate the canonical type of src to.
Returns
bool iff the canonical was propagated.

Definition at line 811 of file abg-ir-priv.h.

◆ push_composite_type_comparison_operands()

void push_composite_type_comparison_operands ( const type_base left,
const type_base right 
)
inline

Push a pair of operands on the stack of operands of the current type comparison, during type canonicalization.

For more information on this, please look at the description of the right_type_comp_operands_ data member.

Parameters
leftthe left-hand-side comparison operand to push.
rightthe right-hand-side comparison operand to push.

Definition at line 648 of file abg-ir-priv.h.

◆ remove_from_types_with_non_confirmed_propagated_ct()

void remove_from_types_with_non_confirmed_propagated_ct ( const type_base dependant)
inline

Remove a given type from the set of types that have been non-confirmed subjects of the canonical type propagation optimization.

Parameters
dependantthe dependant type to consider.

Definition at line 1111 of file abg-ir-priv.h.

◆ set_is_not_recursive()

void set_is_not_recursive ( const type_base t)
inline

Unflag a type as being recursive.

Parameters
tthe type to unflag

Definition at line 799 of file abg-ir-priv.h.


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