libabigail
Loading...
Searching...
No Matches
abg-ir-priv.h File Reference

This contains the private implementation of the suppression engine of libabigail. More...

#include <algorithm>
#include <iostream>
#include <string>
#include "abg-hash.h"
#include "abg-corpus.h"
#include "abg-tools-utils.h"
Include dependency graph for abg-ir-priv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  class_or_union::priv
 
struct  decl_topo_comp
 A functor to sort decls somewhat topologically. That is, types are sorted in a way that makes the ones that are defined "first" to come first. More...
 
struct  environment::priv
 The private data of the environment type. More...
 
struct  function_type::priv
 The type of the private data of the function_type type. More...
 
class  real_type
 The internal representation of an integral type. More...
 
struct  sort_for_hash_functor
 Functor used to sort types before hashing them. More...
 
struct  translation_unit::priv
 Private type to hold private members of translation_unit. More...
 
struct  type_base::priv
 Definition of the private data of type_base. More...
 
struct  type_or_decl_base::priv
 The private data of type_or_decl_base. More...
 
struct  type_topo_comp
 A functor to sort types somewhat topologically. That is, types are sorted in a way that makes the ones that are defined "first" to come first. More...
 
struct  uint64_t_pair_hash
 The hashing functor for a pair of uint64_t. More...
 

Namespaces

namespace  abigail
 Toplevel namespace for libabigail.
 
namespace  abigail::ir
 The namespace of the internal representation of ABI artifacts like types and decls.
 

Typedefs

typedef unordered_set< const class_or_union * > class_set_type
 A convenience typedef for a set of pointer to class_or_union.
 
typedef unordered_set< const function_type * > fn_set_type
 A convenience typedef for a set of pointer to function_type.
 
typedef unordered_map< uint64_t_pair_type, bool, uint64_t_pair_hashtype_comparison_result_type
 A convenience typedef for a map which key is a pair of uint64_t and which value is a boolean. This is initially intended to cache the result of comparing two (sub-)types.
 
typedef 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 values.
 
typedef unordered_set< uint64_t_pair_type, uint64_t_pair_hashuint64_t_pairs_set_type
 A convenience typedef for a set of uint64_t_pair.
 

Enumerations

enum  comparison_result { COMPARISON_RESULT_DIFFERENT , COMPARISON_RESULT_EQUAL , COMPARISON_RESULT_CYCLE_DETECTED , COMPARISON_RESULT_UNKNOWN }
 The result of structural comparison of type ABI artifacts. More...
 

Functions

template<typename input_iterator , typename deref_lambda >
void canonicalize_types (const input_iterator &begin, const input_iterator &end, deref_lambda deref, bool do_log=false, bool show_stats=false)
 Compute the canonical type for all the IR types of the system.
 
bool compare_using_locations (const decl_base *f, const decl_base *s)
 Compare decls using their locations.
 
template<typename T >
hash_t do_hash_value (const shared_ptr< T > &tod)
 Compute the hash value of an IR node and return it.
 
template<typename T >
hash_t do_hash_value (const T &tod)
 Compute the hash value of an IR node and return it.
 
template<typename T >
hash_t do_hash_value (const T *tod)
 Compute the hash value of an IR node and return it.
 
size_t get_canonical_type_index (const type_base &t)
 Getter of the canonical type index of a given type.
 
size_t get_canonical_type_index (const type_base *t)
 Getter of the canonical type index of a given type.
 
size_t get_canonical_type_index (const type_base_sptr &t)
 Getter of the canonical type index of a given type.
 
template<typename IteratorType , typename deref_lambda >
void hash_and_canonicalize_types (IteratorType begin, IteratorType end, deref_lambda deref, bool do_log=false, bool show_stats=false)
 Hash and canonicalize a sequence of types.
 
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.
 
real_type::modifiers_type operator& (real_type::modifiers_type l, real_type::modifiers_type r)
 Bitwise AND operator for real_type::modifiers_type.
 
real_type::modifiers_typeoperator&= (real_type::modifiers_type &l, real_type::modifiers_type r)
 Bitwise &= operator for real_type::modifiers_type.
 
real_type::modifiers_type operator| (real_type::modifiers_type l, real_type::modifiers_type r)
 Bitwise OR operator for real_type::modifiers_type.
 
real_type::modifiers_typeoperator|= (real_type::modifiers_type &l, real_type::modifiers_type r)
 Bitwise |= operator for real_type::modifiers_type.
 
real_type::modifiers_type operator~ (real_type::modifiers_type l)
 Bitwise one's complement operator for real_type::modifiers_type.
 
bool parse_real_type (const string &str, real_type &type)
 Parse a real type from a string.
 
template<typename T >
hash_t set_or_get_cached_hash_value (const T &tod)
 Set the hash value of an IR node and return it.
 
template<typename T >
hash_t set_or_get_cached_hash_value (const T *artifact)
 Set the hash value of an IR node and return it.
 
template<typename IteratorType , typename deref_lambda >
void sort_and_canonicalize_types (IteratorType begin, IteratorType end, deref_lambda deref)
 Sort and canonicalize a sequence of types.
 
template<typename IteratorType >
void sort_types_for_hash_computing_and_c14n (IteratorType begin, IteratorType end)
 Sort types before hashing (and then canonicalizing) them.
 
void sort_types_for_hash_computing_and_c14n (vector< type_base_sptr > &types)
 Sort types right before hashing and canonicalizing them.
 
bool type_is_suitable_for_hash_computing (const type_base &t)
 Test if we should attempt to compute a hash value for a given type.
 
bool type_originates_from_corpus (type_base_sptr t, corpus_sptr &c)
 Test if a type originates from a corpus.
 

Detailed Description

This contains the private implementation of the suppression engine of libabigail.

Definition in file abg-ir-priv.h.