20#include <unordered_map>
21#include <unordered_set>
55using std::unordered_map;
58using std::unordered_set;
60typedef unordered_set<string> string_set_type;
63using namespace std::rel_ops;
96typedef shared_ptr<corpus> corpus_sptr;
99typedef shared_ptr<corpus_group> corpus_group_sptr;
125typedef shared_ptr<type_base> type_base_sptr;
153typedef shared_ptr<decl_base> decl_base_sptr;
185typedef shared_ptr<class_or_union> class_or_union_sptr;
186typedef weak_ptr<class_or_union> class_or_union_wptr;
206typedef shared_ptr<union_decl> union_decl_sptr;
230typedef shared_ptr<qualified_type_def> qualified_type_def_sptr;
273typedef shared_ptr<method_decl> method_decl_sptr;
335typedef shared_ptr<member_function_template> member_function_template_sptr;
336typedef vector<member_function_template_sptr> member_function_templates;
339typedef shared_ptr<member_class_template> member_class_template_sptr;
340typedef vector<member_class_template_sptr> member_class_templates;
530 const class_or_union_sptr&);
549 bool look_through_qualifiers=
false);
553 bool look_through_qualifiers=
false);
584 bool look_through_qualifiers=
false);
588 bool look_through_qualifiers=
false);
592 bool look_through_qualifiers=
false);
609qualified_type_def_sptr
693 vector<decl_base_sptr >::iterator,
698 vector<decl_base_sptr >::iterator,
847const class_or_union_sptr
850const class_or_union_sptr
853const class_or_union_sptr
858 bool look_through_qualifiers =
false);
862 bool look_through_qualifiers =
false);
867qualified_type_def_sptr
1033 bool peel_qual_type);
1045qualified_type_def_sptr
1056 bool qualified =
true);
1069 const type_base_sptr& type);
1079 bool qualified =
true,
1080 bool internal =
false);
1084 bool qualified =
true,
1085 bool internal =
false);
1089 bool qualified =
true,
1090 bool internal =
false);
1094 bool qualified =
true,
1095 bool internal =
false);
1099 bool lvalue_reference =
false,
1100 bool qualified =
true,
1101 bool internal =
false);
1105 bool internal =
false);
1136 bool internal =
false);
1152 bool internal =
false);
1162 bool internal =
false);
1166 const string& indent,
1169 bool qualified_name =
true);
1173 const string& indent,
1176 bool qualified_name =
true);
1180 const string& indent,
1183 bool qualified_name =
true);
1187 const string& indent,
1190 bool qualified_names);
1194 const string& indent,
1197 bool qualified_names);
1201 const string& indent,
1203 bool qualified_names);
1207 const string& indent,
1210 bool qualified_name);
1256 const type_base_sptr);
1260 const decl_base_sptr);
1276 std::list<string>&);
1429qualified_type_def_sptr
1432qualified_type_def_sptr
1435qualified_type_def_sptr
1438qualified_type_def_sptr
1465 bool lvalue_reference,
1541 const string& tu_path,
1579canonicalize(type_base_sptr type,
bool do_log=
false,
bool show_stats=
false);
1586 type_base_sptr t_v2);
1630 const type_base_sptr& second,
1631 bool indirect_type =
false);
1636 bool indirect_type =
false);
1666namespace symtab_reader
1676dump(
const decl_base_sptr, std::ostream&);
1679dump(
const decl_base_sptr);
1682dump(
const type_base_sptr, std::ostream&);
1685dump(
const type_base_sptr);
1718#define ABG_ASSERT(cond) do {({bool __abg_cond__ = bool(cond); assert(__abg_cond__); !!__abg_cond__;});} while (false)
std::shared_ptr< symtab > symtab_sptr
Convenience typedef for a shared pointer to a symtab.
Declaration of types pertaining to the interned string pool used throughout Libabigail,...
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
The abstraction of an interned string.
The abstraction of an array type.
Abstracts a class declaration.
The base type of class_decl and union_decl.
Abstract a class template.
Abstraction of a group of corpora.
This is the abstraction of a set of translation units (themselves seen as bundles of unitary abi arte...
The base type of all declarations.
The abstraction for a data member context relationship. This relates a data member to its parent clas...
Abstracts a declaration for an enum type.
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Abstraction for a function declaration.
Abstract a function template declaration.
Abstraction of a function type.
This abstracts the global scope of a given translation unit.
The base class for the visitor type hierarchy used for traversing a translation unit.
The entry point to manage locations.
The source location of a token.
Abstraction of a member function context relationship. This relates a member function to its parent c...
Abstracts a member class template template.
Abstract a member function template.
Abstraction of the declaration of a method.
Abstracts the type of a class member function.
The abstraction of a namespace declaration.
Abstracts non type template parameters.
The abstraction of a pointer type.
The abstraction of a pointer-to-member type.
The abstraction of a qualified type.
Abstracts a reference type.
A declaration that introduces a scope.
A type that introduces a scope.
The base class of templates.
Base class for a template parameter. Client code should use the more specialized type_template_parame...
Abstracts a template template parameter.
This is the abstraction of the set of relevant artefacts (types, variable declarations,...
An abstraction helper for type declarations.
This abstracts a composition of types based on template type parameters. The result of the compositio...
A basic type declaration that introduces no scope.
The base class of both types and declarations.
Abstracts a type template parameter.
The abstraction of a typedef declaration.
Abstracts a union type declaration.
Abstracts a variable declaration.
Base type of a direct suppression specifications types.
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
weak_ptr< diff > diff_wptr
Convenience typedef for a weak_ptr for the diff class.
shared_ptr< diff_context > diff_context_sptr
Convenience typedef for a shared pointer of diff_context.
weak_ptr< diff_context > diff_context_wptr
Convenience typedef for a weak pointer of diff_context.
The namespace of the internal representation of ABI artifacts like types and decls.
shared_ptr< type_tparameter > type_tparameter_sptr
Convenience typedef for a shared pointer to type_tparameter.
shared_ptr< reference_type_def > reference_type_def_sptr
Convenience typedef for a shared pointer on a reference_type_def.
const type_base_sptr lookup_type_in_scope(const string &fqn, const scope_decl_sptr &skope)
Lookup a type in a scope.
bool is_non_canonicalized_type(const type_base *t)
Test if a given type is allowed to be non canonicalized.
shared_ptr< dm_context_rel > dm_context_rel_sptr
A convenience typedef for a shared pointer to dm_context_rel.
bool get_member_function_is_dtor(const function_decl &f)
Test whether a member function is a destructor.
const type_base * peel_qualified_type(const type_base *type)
Return the leaf underlying type of a qualified type.
weak_ptr< typedef_decl > typedef_decl_wptr
Convenience typedef for a weak pointer on a typedef_decl.
type_decl_sptr lookup_basic_type(const interned_string &type_name, const translation_unit &tu)
Lookup a basic type from a translation unit.
shared_ptr< method_type > method_type_sptr
Convenience typedef for shared pointer to method_type.
size_t hash_type(const type_base *t)
Hash an ABI artifact that is a type.
void fqn_to_components(const string &fqn, list< string > &comps)
Decompose a fully qualified name into the list of its components.
var_decl_sptr get_last_data_member(const class_or_union &klass)
Get the last data member of a class type.
bool is_anonymous_or_typedef_named(const decl_base &d)
Test if a given decl is anonymous or has a naming typedef.
weak_ptr< var_decl > var_decl_wptr
Convenience typedef for a weak pointer on a var_decl.
bool is_template_parm_composition_type(const shared_ptr< decl_base > decl)
Tests whether a decl is a template parameter composition type.
bool get_member_is_static(const decl_base &d)
Gets a flag saying if a class member is static or not.
pointer_type_def_sptr is_pointer_to_npaf_type(const type_base_sptr &t)
Test if we are looking at a pointer to a neither-a-pointer-to-an-array-nor-a-function type.
bool debug_equals(const type_or_decl_base *l, const type_or_decl_base *r)
Test if two ABI artifacts are equal.
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
const type_base_wptrs_type * lookup_enum_types(const interned_string &qualified_name, const corpus &corp)
Look into a given corpus to find the enum type*s* that have a given qualified name.
pointer_type_def_sptr is_pointer_to_array_type(const type_base_sptr &t)
Test if a type is a pointer to array type.
shared_ptr< class_tdecl > class_tdecl_sptr
Convenience typedef for a shared pointer on a class_tdecl.
weak_ptr< function_type > function_type_wptr
Convenience typedef for a weak pointer on a function_type.
type_base_sptr lookup_class_or_typedef_type(const string &qualified_name, const corpus &corp)
Look into a corpus to find a class, union or typedef type which has a given qualified name.
ssize_t get_member_function_vtable_offset(const function_decl &f)
Get the vtable offset of a member function.
vector< type_base_wptr > type_base_wptrs_type
A convenience typedef for a vector of type_base_wptr.
scope_decl * get_type_scope(type_base *t)
Get the scope of a given type.
const scope_decl * is_scope_decl(const decl_base *d)
Test if a declaration is a scope_decl.
qualified_type_def_sptr clone_qualified_type(const qualified_type_def_sptr &t)
Clone a qualifiend type.
const type_base * is_void_pointer_type(const type_base *t)
Test if a type is a pointer to void type.
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
bool is_anonymous_data_member(const decl_base &d)
Test if a decl is an anonymous data member.
bool is_template_parameter(const shared_ptr< decl_base > decl)
Tests whether a decl is a template parameter.
weak_ptr< type_base > type_base_wptr
Convenience typedef for a weak pointer on a type_base.
type_base_sptr peel_reference_type(const type_base_sptr &type)
Return the leaf pointed-to type node of a reference_type_def node.
bool has_scope(const decl_base &d)
Tests if a declaration has got a scope.
type_base_sptr lookup_type_from_translation_unit(const string &type_name, const string &tu_path, const corpus &corp)
Lookup a type from a given translation unit present in a give corpus.
type_base * get_exemplar_type(const type_base *type)
For a given type, return its exemplar type.
shared_ptr< non_type_tparameter > non_type_tparameter_sptr
Convenience typedef for shared pointer to non_type_template_parameter.
class_decl_sptr is_compatible_with_class_type(const type_base_sptr &t)
Test if a type is a class. This function looks through typedefs.
void remove_decl_from_scope(decl_base_sptr decl)
Remove a given decl from its scope.
bool odr_is_relevant(const type_or_decl_base &artifact)
By looking at the language of the TU a given ABI artifact belongs to, test if the ONE Definition Rule...
array_type_def_sptr clone_array(const array_type_def_sptr &array)
Clone an array type.
var_decl_sptr find_last_data_member_matching_regexp(const class_or_union &t, const regex::regex_t_sptr ®ex)
Find the last data member of a class or union which name matches a regular expression.
const ptr_to_mbr_type * is_ptr_to_mbr_type(const type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a ptr_to_mbr_type.
const var_decl_sptr get_first_non_anonymous_data_member(const var_decl_sptr anon_dm)
Get the first non-anonymous data member of a given anonymous data member.
class_decl_sptr lookup_class_type_through_scopes(const list< string > &fqn, const translation_unit &tu)
Lookup a class type from a translation unit by walking its scopes in sequence and by looking into the...
string get_enum_flat_representation(const enum_type_decl &enum_type, const string &indent, bool one_line, bool qualified_names)
Get the flat representation of an instance of enum_type_decl type.
bool is_user_defined_type(const type_base *t)
Test if a type is user-defined.
weak_ptr< class_decl > class_decl_wptr
Convenience typedef for a weak pointer on a class_decl.
string components_to_type_name(const list< string > &comps)
Turn a set of qualified name components (that name a type) into a qualified name string.
void debug_comp_stack(const environment &env)
Emit a trace of the two comparison operands stack on the standard error stream.
bool collect_non_anonymous_data_members(const class_or_union *cou, string_decl_base_sptr_map &dms)
Collect all the non-anonymous data members of a class or union type.
shared_ptr< global_scope > global_scope_sptr
Convenience typedef for shared pointer on global_scope.
bool is_class_type(const type_or_decl_base &t)
Test whether a type is a class.
type_base_sptr synthesize_type_from_translation_unit(const type_base_sptr &type, translation_unit &tu)
In a translation unit, lookup a given type or synthesize it if it's a qualified type.
void set_member_function_virtuality(function_decl &fn, bool is_virtual, ssize_t voffset)
Set the virtual-ness of a member fcuntion.
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
function_type_sptr lookup_or_synthesize_fn_type(const function_type_sptr &fn_t, const corpus &corpus)
Look into an ABI corpus for a function type.
bool is_declaration_only_class_or_union_type(const type_base *t, bool look_through_decl_only)
Test wheter a type is a declaration-only class.
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...
bool is_anonymous_type(const type_base *t)
Test whether a declaration is a type.
type_base_sptr lookup_class_typedef_or_enum_type(const string &qualified_name, const corpus &corp)
Look into a corpus to find a class, typedef or enum type which has a given qualified name.
type_base_sptr peel_const_qualified_type(const qualified_type_def_sptr &q)
If a qualified type is const, then return its underlying type.
const class_or_union_sptr data_member_has_anonymous_type(const var_decl &d)
Test if a data member has annonymous type or not.
type_decl * is_integral_type(const type_or_decl_base *t)
Test if a type is an integral type.
bool anonymous_data_member_exists_in_class(const var_decl &anon_dm, const class_or_union &clazz)
Test if a given anonymous data member exists in a class or union.
class_decl_sptr lookup_class_type_per_location(const interned_string &loc, const corpus &corp)
Look up a class_decl from a given corpus by its location.
void set_member_function_is_dtor(function_decl &f, bool d)
Set the destructor-ness property of a member function.
const type_base_sptr peel_array_type(const type_base_sptr &type)
Return the leaf element type of an array.
reference_type_def_sptr lookup_reference_type(const interned_string &type_name, const translation_unit &tu)
Lookup a reference type from a translation unit.
bool types_have_similar_structure(const type_base_sptr &first, const type_base_sptr &second, bool indirect_type)
Test if two types have similar structures, even though they are (or can be) different.
shared_ptr< template_parameter > template_parameter_sptr
Convenience typedef for shared pointer to template parameter.
class_or_union * is_class_or_union_type(const type_or_decl_base *t)
Test if a type is a class_or_union.
var_decl_sptr get_data_member(class_or_union *clazz, const char *member_name)
Get a given data member, referred to by its name, of a class type.
type_base * look_through_decl_only_type(type_base *t)
If a type is is decl-only, then get its definition. Otherwise, just return the initial type.
const var_decl_sptr get_next_data_member(const class_or_union *klass, const var_decl_sptr &data_member)
In the context of a given class or union, this function returns the data member that is located after...
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
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 set_member_function_is_const(function_decl &f, bool is_const)
set the const-ness property of a member function.
decl_base_sptr strip_useless_const_qualification(const qualified_type_def_sptr t)
Strip qualification from a qualified type, when it makes sense.
namespace_decl_sptr is_namespace(const decl_base_sptr &d)
Tests if a declaration is a namespace declaration.
const type_decl * is_type_decl(const type_or_decl_base *t)
Test whether a type is a type_decl (a builtin type).
decl_base * is_decl_slow(const type_or_decl_base *t)
Test if an ABI artifact is a declaration.
decl_base_sptr look_through_decl_only(const decl_base &d)
If a decl is decl-only get its definition. Otherwise, just return nil.
function_type_sptr is_function_type(const type_or_decl_base_sptr &t)
Test whether a type is a function_type.
vector< class_decl_sptr > classes_type
Convenience typedef for a vector of class_decl_sptr.
string get_name(const type_or_decl_base *tod, bool qualified)
Build and return a copy of the name of an ABI artifact that is either a type or a decl.
typedef_decl_sptr is_typedef(const type_or_decl_base_sptr t)
Test whether a type is a typedef.
shared_ptr< template_tparameter > template_tparameter_sptr
Convenience typedef for a shared_ptr to template_tparameter.
uint64_t get_var_size_in_bits(const var_decl_sptr &v)
Get the size of a given variable.
weak_ptr< corpus > corpus_wptr
Convenience typedef for a weak pointer to a corpus.
enum_type_decl_sptr lookup_enum_type_per_location(const interned_string &loc, const corpus &corp)
Look up an enum_type_decl from a given corpus, by its location.
string get_debug_representation(const type_or_decl_base *artifact)
Get the textual representation of a type for debugging purposes.
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
function_type_sptr synthesize_function_type_from_translation_unit(const function_type &fn_type, translation_unit &tu)
In a translation unit, lookup the sub-types that make up a given function type and if the sub-types a...
type_base_sptr peel_pointer_type(const type_base_sptr &type)
Return the leaf pointed-to type node of a pointer_type_def node.
class_decl_sptr lookup_class_type(const string &fqn, const translation_unit &tu)
Lookup a class type from a translation unit.
type_base_sptr lookup_type_through_translation_units(const string &qn, const corpus &abi_corpus)
Lookup a type definition in all the translation units of a given ABI corpus.
qualified_type_def_sptr is_array_of_qualified_element(const array_type_def_sptr &array)
Tests if the element of a given array is a qualified type.
bool is_typedef_of_maybe_qualified_class_or_union_type(const type_base *t)
Test if a type is a typedef of a class or union type, or a typedef of a qualified class or union type...
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...
vector< function_type_sptr > function_types_type
Convenience typedef fo a vector of function_type_sptr.
reference_type_def * is_reference_type(type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a reference_type_def.
bool lookup_decl_only_class_types(const interned_string &qualified_name, const corpus &corp, type_base_wptrs_type &result)
Look into a given corpus to find the class type*s* that have a given qualified name and that are decl...
bool member_function_has_vtable_offset(const function_decl &f)
Test if a virtual member function has a vtable offset set.
decl_base_sptr insert_decl_into_scope(decl_base_sptr decl, scope_decl::declarations::iterator before, scope_decl *scope)
Inserts a declaration into a given scope, before a given IR child node of the scope.
const enum_type_decl * is_enum_type(const type_or_decl_base *d)
Test if a decl is an enum_type_decl.
unordered_map< interned_string, type_base_wptrs_type, hash_interned_string > istring_type_base_wptrs_map_type
A convenience typedef for a map which key is an interned_string and which value is a vector of type_b...
bool function_decl_is_less_than(const function_decl &f, const function_decl &s)
Test if the pretty representation of a given function_decl is lexicographically less then the pretty ...
var_decl_sptr find_data_member_from_anonymous_data_member(const var_decl_sptr &anon_dm, const string &name)
Find a data member inside an anonymous data member.
const global_scope * get_global_scope(const decl_base &decl)
return the global scope as seen by a given declaration.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
shared_ptr< ptr_to_mbr_type > ptr_to_mbr_type_sptr
Convenience typedef for a shared pointer to a ptr_to_mbr_type.
const location & get_natural_or_artificial_location(const decl_base *decl)
Get the non-artificial (natural) location of a decl.
size_t hash_type_or_decl(const type_or_decl_base *tod)
Hash an ABI artifact that is either a type or a decl.
bool is_template_decl(const decl_base_sptr &decl)
Tests whether a decl is a template.
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
pointer_type_def_sptr lookup_pointer_type(const interned_string &type_name, const translation_unit &tu)
Lookup a pointer type from a translation unit.
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
shared_ptr< environment > environment_sptr
Convenience typedef for a shared pointer to an environment.
bool is_data_member_of_anonymous_class_or_union(const var_decl &d)
Test if a var_decl is a data member belonging to an anonymous type.
const type_base * is_void_pointer_type_equivalent(const type_base *type)
Test if a type is equivalent to a pointer to void type.
const decl_base_sptr lookup_var_decl_in_scope(const string &fqn, const scope_decl_sptr &skope)
Lookup a var_decl in a scope.
type_base * type_has_non_canonicalized_subtype(type_base_sptr t)
Test if a type has sub-types that are non-canonicalized.
unordered_map< string, decl_base_sptr > string_decl_base_sptr_map
Convenience typedef for a map which key is a string and which value is a decl_base_sptr.
qualified_type_def_sptr lookup_qualified_type(const interned_string &type_name, const translation_unit &tu)
Lookup a qualified type from a translation unit.
const type_base_sptr lookup_type(const interned_string &fqn, const translation_unit &tu)
Lookup a type in a translation unit.
bool get_data_member_is_laid_out(const var_decl &m)
Test whether a data member is laid out.
union_decl_sptr lookup_union_type(const interned_string &type_name, const translation_unit &tu)
Lookup a union type from a translation unit.
bool get_member_function_is_const(const function_decl &f)
Test whether a member function is const.
interned_string get_name_of_reference_to_type(const type_base &pointed_to_type, bool lvalue_reference, bool qualified, bool internal)
Get the name of the reference to a given type.
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
unordered_map< string, translation_unit_sptr > string_tu_map_type
Convenience typedef for a map that associates a string to a translation unit.
bool is_const_qualified_type(const qualified_type_def_sptr &t)
Test if a given qualified type is const.
type_base_sptr lookup_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a type from a corpus, by its location.
bool get_next_data_member_offset(const class_or_union *klass, const var_decl_sptr &dm, uint64_t &offset)
Get the offset of the non-static data member that comes after a given one.
uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
shared_ptr< ir_traversable_base > ir_traversable_base_sptr
Convenience typedef for a shared pointer to ir_traversable_base.
bool is_member_function(const function_decl &f)
Test whether a function_decl is a member function.
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
void keep_type_alive(type_base_sptr t)
Make sure that the life time of a given (smart pointer to a) type is the same as the life time of the...
array_type_def_sptr lookup_array_type(const interned_string &type_name, const translation_unit &tu)
Lookup an array type from a translation unit.
bool is_member_type(const type_base_sptr &t)
Tests if a type is a class member.
string get_class_or_union_flat_representation(const class_or_union &cou, const string &indent, bool one_line, bool internal, bool qualified_names)
Get the flat representation of an instance of class_or_union type.
decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl *scope)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
string build_internal_underlying_enum_type_name(const string &base_name, bool is_anonymous, uint64_t size)
Build the internal name of the underlying type of an enum.
bool is_npaf_type(const type_base_sptr &t)
Test if a type is a neither a pointer, an array nor a function type.
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
void set_data_member_offset(var_decl_sptr m, uint64_t o)
Set the offset of a data member into its containing class.
type_base_sptr strip_typedef(const type_base_sptr type)
Recursively returns the the underlying type of a typedef. The return type should not be a typedef of ...
uint64_t get_data_member_offset(const var_decl &m)
Get the offset of a data member.
vector< class_or_union_sptr > classes_or_unions_type
Convenience typedef for a vector of class_or_union_sptr.
class_or_union * is_at_class_scope(const decl_base_sptr decl)
Tests whether a given decl is at class scope.
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
const pointer_type_def * is_pointer_type(const type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a pointer_type_def.
string get_class_or_enum_flat_representation(const type_base &coe, const string &indent, bool one_line, bool internal, bool qualified_name)
Get the flat representation of an instance of enum_type_decl type.
class_or_union * anonymous_data_member_to_class_or_union(const var_decl *d)
Get the class_or_union type of a given anonymous data member.
location get_location(const type_base_sptr &type)
Get the location of the declaration of a given type.
pointer_type_def_sptr is_pointer_to_function_type(const type_base_sptr &t)
Test if a type is a pointer to function type.
translation_unit * get_translation_unit(const type_or_decl_base &t)
Return the translation unit a declaration belongs to.
weak_ptr< decl_base > decl_base_wptr
Convenience typedef for a weak pointer to a decl_base.
var_decl_sptr has_fake_flexible_array_data_member(const class_decl &klass)
Test if the last data member of a class is an array with one element.
interned_string get_function_type_name(const function_type_sptr &fn_type, bool internal)
Get the name of a given function type and return a copy of it.
bool is_function_template_pattern(const shared_ptr< decl_base > decl)
Test whether a decl is the pattern of a function template.
class_or_union * look_through_decl_only_class(class_or_union *the_class)
If a class (or union) is a decl-only class, get its definition. Otherwise, just return the initial cl...
bool is_union_type(const type_or_decl_base &t)
Test if a type is a union_decl.
const location & get_artificial_or_natural_location(const decl_base *decl)
Get the artificial location of a decl.
enum_type_decl_sptr lookup_enum_type(const interned_string &type_name, const translation_unit &tu)
Lookup an enum type from a translation unit.
type_base_sptr peel_typedef_type(const type_base_sptr &type)
Return the leaf underlying type node of a typedef_decl node.
const type_base_wptrs_type * lookup_union_types(const interned_string &qualified_name, const corpus &corp)
Look into a given corpus to find the union type*s* that have a given qualified name.
shared_ptr< template_decl > template_decl_sptr
Convenience typedef for a shared pointer to template_decl.
array_type_def_sptr is_typedef_of_array(const type_base_sptr &t)
Test if a type is a typedef of an array.
function_type_sptr lookup_function_type(const interned_string &type_name, const translation_unit &tu)
Lookup a function type from a translation unit.
bool is_global_scope(const scope_decl &scope)
Tests whether if a given scope is the global scope.
void set_data_member_is_laid_out(var_decl_sptr m, bool l)
Set a flag saying if a data member is laid out.
pointer_type_def_sptr is_pointer_to_ptr_to_mbr_type(const type_base_sptr &t)
Test if we are looking at a pointer to pointer to member type.
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
var_decl_sptr find_first_data_member_matching_regexp(const class_or_union &t, const regex::regex_t_sptr &r)
Find the first data member of a class or union which name matches a regular expression.
const type_base_wptrs_type * lookup_class_types(const interned_string &qualified_name, const corpus &corp)
Look into a given corpus to find the class type*s* that have a given qualified name.
const decl_base * get_type_declaration(const type_base *t)
Get the declaration for a given type.
var_decl_sptr has_flexible_array_data_member(const class_decl &klass)
Test if the last data member of a class is an array with non-finite data member.
shared_ptr< type_composition > type_composition_sptr
Convenience typedef for shared pointer to type_composition.
void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
type_base_sptr canonicalize(type_base_sptr t, bool do_log, bool show_stats)
Compute the canonical type of a given type.
array_type_def * is_array_type(const type_or_decl_base *type, bool look_through_qualifiers)
Test if a type is an array_type_def.
interned_string get_method_type_name(const method_type_sptr fn_type, bool internal)
Get the name of a given method type and return a copy of it.
weak_ptr< template_decl > template_decl_wptr
Convenience typedef for a weak pointer to template_decl.
shared_ptr< mem_fn_context_rel > mem_fn_context_rel_sptr
A convenience typedef for a shared pointer to mem_fn_context_rel.
interned_string get_function_id_or_pretty_representation(const function_decl *fn)
Get the ID of a function, or, if the ID can designate several different functions,...
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
typedef_decl_sptr clone_typedef(const typedef_decl_sptr &t)
Clone a typedef type.
type_decl_sptr lookup_basic_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a type_decl type from a given corpus, by its location.
const type_base_sptr lookup_type_through_scopes(const type_base_sptr type, const translation_unit &tu)
Lookup a type from a translation unit by walking the scopes of the translation unit in sequence and l...
void strip_redundant_quals_from_underyling_types(const qualified_type_def_sptr &t)
Merge redundant qualifiers from a tree of qualified types.
type_or_decl_base * debug(const type_or_decl_base *artifact)
Emit a textual representation of an artifact to std error stream for debugging purposes.
shared_ptr< namespace_decl > namespace_decl_sptr
Convenience typedef for a shared pointer on namespace_decl.
string demangle_cplus_mangled_name(const string &mangled_name)
Demangle a C++ mangled name and return the resulting string.
bool is_unique_type(const type_base_sptr &t)
Test if a type is unique in the entire environment.
bool types_are_compatible(const type_base_sptr type1, const type_base_sptr type2)
Test if two types are equal modulo a typedef.
interned_string get_type_name(const type_base_sptr &t, bool qualified, bool internal)
Get the name of a given type and return a copy of it.
const scope_decl * get_top_most_scope_under(const decl_base *decl, const scope_decl *scope)
Return the a scope S containing a given declaration and that is right under a given scope P.
type_base_sptr clone_array_tree(const type_base_sptr t)
Clone a type tree made of an array or a typedef of array.
interned_string get_name_of_pointer_to_type(const type_base &pointed_to_type, bool qualified, bool internal)
Get the name of the pointer to a given type.
bool is_at_template_scope(const shared_ptr< decl_base > decl)
Tests whether a given decl is at template scope.
typedef_decl_sptr lookup_typedef_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a typedef_decl from a corpus, by its location.
function_decl * is_function_decl(const type_or_decl_base *d)
Test whether a declaration is a function_decl.
bool type_has_sub_type_changes(const type_base_sptr t_v1, const type_base_sptr t_v2)
Tests if the change of a given type effectively comes from just its sub-types. That is,...
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.
typedef_decl_sptr lookup_typedef_type(const interned_string &type_name, const translation_unit &tu)
Lookup a typedef type from a translation unit.
bool is_typedef_ptr_or_ref_to_decl_only_class_or_union_type(const type_base *t)
Test if a type is a typedef, pointer or reference to a decl-only class/union.
union_decl_sptr lookup_union_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a union type in a given corpus, from its location.
bool class_or_union_types_of_same_kind(const class_or_union *first, const class_or_union *second)
Test if two class or union types are of the same kind.
string build_qualified_name(const scope_decl *scope, const string &name)
Build and return a qualified name from a name and its scope.
enum_type_decl_sptr look_through_decl_only_enum(const enum_type_decl &the_enum)
If an enum is a decl-only enum, get its definition. Otherwise, just return the initial enum.
shared_ptr< function_tdecl > function_tdecl_sptr
Convenience typedef for a shared pointer on a function_tdecl.
enum_type_decl_sptr is_compatible_with_enum_type(const type_base_sptr &t)
Test if a type is an enum. This function looks through typedefs.
type_base * peel_qualified_or_typedef_type(const type_base *type)
Return the leaf underlying type of a qualified or typedef type.
type_base_sptr type_or_void(const type_base_sptr t, const environment &env)
Return either the type given in parameter if it's non-null, or the void type.
bool is_at_global_scope(const decl_base &decl)
Tests whether a given declaration is at global scope.
vector< enum_type_decl_sptr > enums_type
Convenience typedef for a vector of enum_type_decl_sptr.
type_decl * is_real_type(const type_or_decl_base *t)
Test if a type is a real type.
bool is_member_decl(const decl_base_sptr d)
Tests if a declaration is a class member.
bool get_member_function_is_ctor(const function_decl &f)
Test whether a member function is a constructor.
void set_member_function_is_ctor(function_decl &f, bool c)
Setter for the is_ctor property of the member function.
std::shared_ptr< regex_t > regex_t_sptr
A convenience typedef for a shared pointer of regex_t.
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
Toplevel namespace for libabigail.
void dump(const decl_base_sptr d, std::ostream &o, const bool annotate)
Serialize a pointer to decl_base to an output stream.
void dump_decl_location(const decl_base &d, ostream &o)
Serialize the source location of a decl to an output stream for debugging purposes.
A functor to hash instances of interned_string.
The base of an entity of the intermediate representation that is to be traversed.