23#include <unordered_map>
99using std::unordered_map;
125 size_t operator()(
const type_base_sptr& l)
const;
132typedef unordered_set<type_base_sptr,
150 vector<type_base_sptr>& result);
163 {
return reinterpret_cast<uint64_t
>(t.get());}
183 operator()(
const type_base_sptr& l,
const type_base_sptr& r)
const
184 {
return l.get() == r.get();}
192typedef unordered_set<type_base_sptr,
219 std::unique_ptr<priv> priv_;
225 typedef std::unordered_map<string, std::vector<type_base_sptr> >
238 const type_base_sptr&
241 const type_base_sptr&
244 const type_base_sptr&
275 intern(
const string&)
const;
290 user_set_load_all_types()
const;
293 load_all_types(
bool f);
296 load_all_types()
const;
307#ifdef WITH_DEBUG_SELF_COMPARISON
309 set_self_comparison_debug_input(
const corpus_sptr&
corpus);
312 get_self_comparison_debug_inputs(corpus_sptr& first_corpus,
313 corpus_sptr& second_corpus);
316 self_comparison_debug_is_on(
bool);
319 self_comparison_debug_is_on()
const;
322#ifdef WITH_DEBUG_TYPE_CANONICALIZATION
324 debug_type_canonicalization_is_on(
bool flag);
327 debug_type_canonicalization_is_on()
const;
330 debug_die_canonicalization_is_on(
bool flag);
333 debug_die_canonicalization_is_on()
const;
342 const vector<type_base_sptr>&
345#ifdef WITH_DEBUG_SELF_COMPARISON
346 const unordered_map<string, uintptr_t>&
347 get_type_id_canonical_type_map()
const;
349 unordered_map<string, uintptr_t>&
350 get_type_id_canonical_type_map();
352 const unordered_map<uintptr_t, string>&
353 get_pointer_type_id_map()
const;
355 unordered_map<uintptr_t, string>&
356 get_pointer_type_id_map();
359 get_type_id_from_pointer(uintptr_t ptr)
const;
362 get_type_id_from_type(
const type_base *ptr)
const;
365 get_canonical_type_from_type_id(
const char*)
const;
387 std::unique_ptr<priv> priv_;
392 get_location_manager()
const;
402 get_artificial_value()
const;
417 operator bool()
const;
426 expand(std::string& path,
unsigned& line,
unsigned& column)
const;
442 std::unique_ptr<priv> priv_;
455 unsigned& line,
unsigned& column)
const;
494 return repr1 == repr2;
530 std::hash<string> do_hash;
531 return do_hash(repr);
567typedef unordered_map<interned_string, type_base_wptr, hash_interned_string>
595 std::unique_ptr<priv> priv_;
678 const vector<type_base_wptr>&
682 get_type_map(
const std::type_info&);
685 get_type_map(
const std::type_info&)
const;
699 std::unique_ptr<priv> priv_;
768 const std::string& path,
769 char address_size = 0);
855 lookup_function_type_in_translation_unit(
const function_type& t,
862 friend type_base_sptr
881 {
return lhs->get_absolute_path() < rhs->get_absolute_path();}
931typedef std::unordered_map<string, elf_symbol_sptr>
936typedef shared_ptr<string_elf_symbol_sptr_map_type>
944typedef std::unordered_map<string, elf_symbols>
987 PROTECTED_VISIBILITY,
997 std::unique_ptr<priv> priv_;
1016 elf_symbol(
const elf_symbol&);
1019 operator=(
const elf_symbol& s);
1024 create(
const environment& e,
1169 get_alias_with_default_symbol_version()
const;
1173 bool include_symbol_itself =
true)
const;
1224compute_aliases_for_elf_symbol(
const elf_symbol& symbol,
1226 vector<elf_symbol_sptr>& alias_set);
1232 std::unique_ptr<priv> priv_;
1244 operator const string&()
const;
1250 str(
const string& s);
1286 std::unique_ptr<priv> priv_;
1305 get_access_specifier()
const;
1311 get_is_static()
const;
1314 set_is_static(
bool s);
1374 bool qualified_name =
true,
bool linkage_name =
true);
1390 ABSTRACT_TYPE_OR_DECL,
1391 ABSTRACT_DECL_BASE = 1,
1392 ABSTRACT_SCOPE_DECL = 1 << 1,
1393 GLOBAL_SCOPE_DECL = 1 << 2,
1394 NAMESPACE_DECL = 1 << 3,
1396 FUNCTION_DECL = 1 << 5,
1397 FUNCTION_PARAMETER_DECL = 1 << 6,
1398 METHOD_DECL = 1 << 7,
1399 TEMPLATE_DECL = 1 << 8,
1400 ABSTRACT_TYPE_BASE = 1 << 9,
1401 ABSTRACT_SCOPE_TYPE_DECL = 1 << 10,
1402 BASIC_TYPE = 1 << 11,
1403 SUBRANGE_TYPE = 1 << 12,
1404 QUALIFIED_TYPE = 1 << 13,
1405 POINTER_TYPE = 1 << 14,
1406 REFERENCE_TYPE = 1 << 15,
1407 POINTER_TO_MEMBER_TYPE = 1 << 16,
1408 ARRAY_TYPE = 1 << 17,
1409 ENUM_TYPE = 1 << 18,
1410 TYPEDEF_TYPE = 1 << 19,
1411 CLASS_TYPE = 1 << 20,
1412 UNION_TYPE = 1 << 21,
1413 FUNCTION_TYPE = 1 << 22,
1414 METHOD_TYPE = 1 << 23,
1443 set_hash_value(
hash_t)
const;
1450 mutable std::unique_ptr<priv> priv_;
1508 std::recursive_mutex&
1515 get_pretty_representation(
bool internal =
false,
1516 bool qualified_name =
true)
const = 0;
1552 template<
typename T>
1615 std::unique_ptr<priv> priv_;
1625 VISIBILITY_PROTECTED,
1651 const string& mangled_name =
"",
1681 bool qualified_name =
true)
const;
1688 bool internal =
false)
const;
1729 std::list<typedef_decl_sptr>&
1753 const decl_base_sptr
1759 const decl_base_sptr
1776 bool qualified_name ,
bool linkage_name);
1789 friend decl_base_sptr
1795 friend decl_base_sptr
1796 insert_decl_into_scope(decl_base_sptr,
1797 vector<shared_ptr<decl_base> >::iterator,
1831operator==(
const decl_base_sptr&,
const decl_base_sptr&);
1834operator!=(
const decl_base_sptr&,
const decl_base_sptr&);
1837operator==(
const type_base_sptr&,
const type_base_sptr&);
1840operator!=(
const type_base_sptr&,
const type_base_sptr&);
1857 std::unique_ptr<priv> priv_;
1873 const string& name,
const location& locus,
1946 friend decl_base_sptr
1949 friend decl_base_sptr
1951 scope_decl::declarations::iterator before,
1957 friend decl_base_sptr
1959 decl_base_sptr member,
1960 declarations::iterator before);
1963 insert_member_type(type_base_sptr t,
1964 declarations::iterator before);
1969 friend decl_base_sptr
1975 friend type_base_sptr
1993 std::unique_ptr<priv> priv_;
2002 get_translation_unit()
const;
2102 operator()(
const type_base_sptr l,
const type_base_sptr r)
const
2107 if (l.get() == r.get())
2133 size_t size_in_bits,
2134 size_t alignment_in_bits,
2136 const string& mangled_name =
"",
2162 bool internal =
false)
const;
2169 bool qualified_name =
true)
const;
2194 size_t size_in_bits,
size_t alignment_in_bits,
2219 bool qualified_name =
true)
const;
2242 std::unique_ptr<priv> priv_;
2248 string build_name(
bool,
bool internal =
false)
const;
2262 CV_VOLATILE = 1 << 1,
2263 CV_RESTRICT = 1 << 2
2302 bool internal =
false)
const;
2314operator==(
const qualified_type_def_sptr&,
const qualified_type_def_sptr&);
2317operator!=(
const qualified_type_def_sptr&,
const qualified_type_def_sptr&);
2343 bool qualified =
true,
bool internal =
false);
2345qualified_type_def_sptr
2356 std::unique_ptr<priv> priv_;
2369 pointer_type_def(
const type_base_sptr& pointed_to_type,
size_t size_in_bits,
2370 size_t alignment_in_bits,
const location& locus);
2373 size_t alignment_in_bits,
const location& locus);
2390 const type_base_sptr
2422 std::unique_ptr<priv> priv_;
2436 bool lvalue,
size_t size_in_bits,
2437 size_t alignment_in_bits,
const location& locus);
2440 size_t alignment_in_bits,
const location& locus);
2458 get_pointed_to_type()
const;
2465 bool internal =
false)
const;
2472 bool qualified_name =
true)
const;
2491 std::unique_ptr<priv> priv_;
2502 const type_base_sptr& member_type,
2503 const type_base_sptr& containing_type,
2504 size_t size_in_bits,
2505 size_t alignment_in_bits,
2514 const type_base_sptr&
2517 const type_base_sptr&
2531 bool internal =
false)
const;
2554 std::unique_ptr<priv> priv_;
2580 std::unique_ptr<priv> priv_;
2597 UNSIGNED_SIGNEDNESS,
2629 const type_base_sptr& underlying_type,
2705 bool qualified_name =
true)
const;
2712 const std::vector<subrange_sptr>& subs,
2716 const std::vector<subrange_sptr>& subs,
2733 bool internal =
false)
const;
2738 const type_base_sptr
2748 get_dimension_count()
const;
2755 bool qualified_name =
true)
const;
2758 get_subrange_representation()
const;
2764 get_location()
const;
2766 const std::vector<subrange_sptr>&
2798 std::unique_ptr<priv> priv_;
2830 type_base_sptr underlying_type,
2832 const string& mangled_name =
"",
2860 bool qualified_name =
true)
const;
2884 std::unique_ptr<priv> priv_;
2892 enumerator(
const string& name, int64_t value);
2938 std::unique_ptr<priv> priv_;
2949 const type_base_sptr underlying_type,
2951 const string& mangled_name =
"",
2957 const string& mangled_name =
"",
2977 bool qualified_name =
true)
const;
2987 bool internal =
false)
const;
3007 std::unique_ptr<priv> priv_;
3014 size_t offset_in_bits,
3021 get_is_laid_out()
const;
3024 set_is_laid_out(
bool f);
3027 get_offset_in_bits()
const;
3030 set_offset_in_bits(
size_t o);
3071 std::unique_ptr<priv> priv_;
3085 type_base_sptr type,
3087 const string& mangled_name,
3094 const type_base_sptr
3126 bool qualified_name =
true)
const;
3163 bool linkage_name =
true,
bool elf_symbol =
true);
3197 bool declared_inline,
3199 const string& mangled_name,
3204 type_base_sptr fn_type,
3205 bool declared_inline,
3207 const string& mangled_name =
"",
3209 binding bind = BINDING_GLOBAL);
3213 bool qualified_name =
true)
const;
3218 const std::vector<parameter_sptr >&
3227 parameters::const_iterator
3230 parameters::const_iterator
3239 const type_base_sptr
3258 get_binding()
const;
3326 return l_repr < r_repr;
3346 std::unique_ptr<priv> priv_;
3354 bool variadic_marker =
false);
3360 bool variadic_marker,
3361 bool is_artificial);
3366 bool variadic_marker =
false,
3367 bool is_artificial =
false);
3371 bool variadic_marker =
false);
3375 const type_base_sptr
3391 set_index(
unsigned i);
3394 get_variadic_marker()
const;
3407 bool internal =
false)
const;
3411 bool qualified_name =
true)
const;
3444 std::unique_ptr<priv> priv_;
3453 size_t size_in_bits,
3454 size_t alignment_in_bits);
3457 size_t size_in_bits,
3458 size_t alignment_in_bits);
3461 size_t size_in_bits,
3462 size_t alignment_in_bits);
3497 parameters::const_iterator
3500 parameters::const_iterator
3503 parameters::const_iterator
3514 bool qualified_name =
true)
const;
3529 std::unique_ptr<priv> priv_;
3539 class_or_union_sptr class_type,
3540 const std::vector<function_decl::parameter_sptr>& parms,
3542 size_t size_in_bits,
3543 size_t alignment_in_bits);
3546 type_base_sptr class_type,
3547 const std::vector<function_decl::parameter_sptr>& parms,
3549 size_t size_in_bits,
3550 size_t alignment_in_bits);
3554 size_t size_in_bits,
3555 size_t alignment_in_bits);
3558 size_t size_in_bits,
3559 size_t alignment_in_bits);
3587 bool qualified_name =
true)
const;
3597 std::unique_ptr<priv> priv_;
3611 const std::list<template_parameter_sptr>&
3629 std::unique_ptr<priv> priv_;
3649 get_enclosing_template_decl()
const;
3658 std::unique_ptr<priv> priv_;
3692 std::unique_ptr<priv> priv_;
3704 type_base_sptr type,
3712 const type_base_sptr
3725 std::unique_ptr<priv> priv_;
3760 std::unique_ptr<priv> priv_;
3767 type_base_sptr composed_type);
3769 const type_base_sptr
3782 std::unique_ptr<priv> priv_;
3808 shared_ptr<function_decl>
3827 std::unique_ptr<priv> priv_;
3850 shared_ptr<class_decl>
3880 : access_(a), is_static_(is_static)
3900 {
return is_static_;}
3924 bool declared_inline,
const location& locus,
3925 const string& mangled_name =
"",
3927 binding bind = BINDING_GLOBAL);
3931 bool declared_inline,
3933 const string& mangled_name =
"",
3935 binding bind = BINDING_GLOBAL);
3937 method_decl(
const string& name, type_base_sptr type,
3938 bool declared_inline,
const location& locus,
3939 const string& mangled_name =
"",
3941 binding bind = BINDING_GLOBAL);
3953 {function_decl::set_type(fn_type);}
3998operator==(
const method_decl_sptr& l,
const method_decl_sptr& r);
4001operator!=(
const method_decl_sptr& l,
const method_decl_sptr& r);
4034 size_t size_in_bits,
size_t align_in_bits,
4038 bool is_declaration_only =
true);
4109 const member_function_templates&
4112 const member_class_templates&
4132 friend decl_base_sptr
4138 friend decl_base_sptr
4144 bool is_laid_out,
bool is_static,
4145 size_t offset_in_bits);
4151 bool is_static,
bool is_ctor,
4152 bool is_dtor,
bool is_const);
4159 size_t vtable_offset,
4160 bool is_static,
bool is_ctor,
4161 bool is_dtor,
bool is_const);
4165 member_function_template_sptr);
4169 member_class_template_sptr m);
4171 friend method_decl_sptr
4175 friend method_decl_sptr
4177 const method_decl_sptr& m);
4207operator==(
const class_or_union_sptr& l,
const class_or_union_sptr& r);
4210operator!=(
const class_or_union_sptr& l,
const class_or_union_sptr& r);
4251 size_t size_in_bits,
size_t align_in_bits,
4255 size_t size_in_bits,
size_t align_in_bits,
4260 bool is_declaration_only =
true);
4267 bool qualified_name =
true)
const;
4352 const method_decl_sptr& f);
4393 std::unique_ptr<priv> priv_;
4404 long offset_in_bits = -1,
bool is_virtual =
false);
4407 long offset_in_bits = -1,
bool is_virtual =
false);
4458 size_t size_in_bits,
const location& locus,
4462 size_t size_in_bits,
const location& locus,
4466 bool is_declaration_only =
true);
4473 bool qualified_name =
true)
const;
4498 const method_decl_sptr& f);
4505operator==(
const union_decl_sptr& l,
const union_decl_sptr& r);
4508operator!=(
const union_decl_sptr& l,
const union_decl_sptr& r);
4516 std::unique_ptr<priv> priv_;
4528 size_t vtable_offset_in_bits,
4536 is_virtual(
bool is_virtual);
4576 const char* dm_name);
4589 bool is_constructor_;
4591 shared_ptr<function_tdecl> fn_tmpl_;
4602 bool is_constructor,
bool is_const)
4605 member_base(access, is_static), is_constructor_(is_constructor),
4606 is_const_(is_const), fn_tmpl_(f)
4610 is_constructor()
const
4611 {
return is_constructor_;}
4621 as_function_tdecl()
const
4632operator==(
const member_function_template_sptr& l,
4633 const member_function_template_sptr& r);
4636operator!=(
const member_function_template_sptr& l,
4637 const member_function_template_sptr& r);
4644 shared_ptr<class_tdecl> class_tmpl_;
4663 {
return *class_tmpl_; }
4666 as_class_tdecl()
const
4667 {
return class_tmpl_;}
4683operator==(
const member_class_template_sptr& l,
4684 const member_class_template_sptr& r);
4687operator!=(
const member_class_template_sptr& l,
4688 const member_class_template_sptr& r);
4737 bool do_log =
false,
bool show_stats =
false);
4758 std::unique_ptr<priv> priv_;
4822 virtual bool visit_begin(
var_decl*);
4858fns_to_str(vector<function_decl*>::const_iterator a_begin,
4859 vector<function_decl*>::const_iterator a_end,
4860 vector<function_decl*>::const_iterator b_begin,
4861 vector<function_decl*>::const_iterator b_end,
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 abstraction of an interned string.
This class is to hold the value of the bound of a subrange. The value can be either signed or unsigne...
void set_signed(int64_t v)
Setter of the bound value as signed.
void set_signedness(enum signedness s)
Setter of the signedness (unsigned VS signed) of the bound value.
enum signedness get_signedness() const
Getter of the signedness (unsigned VS signed) of the bound value.
int64_t get_signed_value() const
Getter of the bound value as a signed value.
bool operator==(const bound_value &) const
Equality operator of the bound value.
uint64_t get_unsigned_value()
Getter of the bound value as an unsigned value.
bound_value()
Default constructor of the array_type_def::subrange_type::bound_value class.
void set_unsigned(uint64_t v)
Setter of the bound value as unsigned.
Abstraction for an array range type, like in Ada, or just for an array dimension like in C or C++.
void set_lower_bound(int64_t lb)
Setter of the lower bound.
bool is_non_finite() const
Test if the length of the subrange type is infinite.
void set_upper_bound(int64_t ub)
Setter of the upper bound of the subrange type.
void set_underlying_type(const type_base_sptr &)
Setter of the underlying type of the subrange, that is, the type that defines the range.
string as_string() const
Return a string representation of the sub range.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
bool operator!=(const decl_base &o) const
Equality operator.
int64_t get_upper_bound() const
Getter of the upper bound of the subrange type.
type_base_sptr get_underlying_type() const
Getter of the underlying type of the subrange, that is, the type that defines the range.
virtual bool operator==(const decl_base &) const
Equality operator.
int64_t get_lower_bound() const
Getter of the lower bound of the subrange type.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build a pretty representation for an array_type_def::subrange_type.
static string vector_as_string(const vector< subrange_sptr > &)
Return a string representation of a vector of subranges.
uint64_t get_length() const
Getter of the length of the subrange type.
translation_unit::language get_language() const
Getter of the language that generated this type.
The abstraction of an array type.
virtual bool is_non_finite() const
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Build and return the qualified name of the current instance of the array_type_def.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
const type_base_sptr get_element_type() const
Getter of the type of an array element.
void set_element_type(const type_base_sptr &element_type)
Setter of the type of array element.
shared_ptr< subrange_type > subrange_sptr
Convenience typedef for a shared pointer on a function_decl::subrange.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
const std::vector< subrange_sptr > & get_subranges() const
Get the array's subranges.
virtual bool operator==(const decl_base &) const
Return true iff the two decls have the same name.
std::vector< subrange_sptr > subranges_type
Convenience typedef for a vector of subrange_sptr.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of array_type_def.
translation_unit::language get_language() const
Get the language of the array.
virtual void append_subranges(const std::vector< subrange_sptr > &subs)
Append subranges from the vector.
Abstraction of a base specifier in a class declaration.
class_decl_sptr get_base_class() const
Get the base class referred to by the current base class specifier.
bool get_is_virtual() const
Getter of the "is-virtual" proprerty of the base class specifier.
long get_offset_in_bits() const
Getter of the offset of the base.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &)
Traverses an instance of class_decl::base_spec, visiting all the sub-types and decls that it might co...
virtual bool operator==(const decl_base &) const
Comparison operator for class_decl::base_spec.
Abstracts a class declaration.
friend void fixup_virtual_member_function(method_decl_sptr method)
When a virtual member function has seen its virtualness set by set_member_function_is_virtual(),...
bool has_virtual_member_functions() const
Test if the current instance of class_decl has virtual member functions.
const virtual_mem_fn_map_type & get_virtual_mem_fns_map() const
Get the map that associates a virtual table offset to the virtual member functions with that virtual ...
bool is_struct() const
Test if the class is a struct.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
const base_specs & get_base_specifiers() const
Get the base specifiers for this class.
virtual ~class_decl()
Destructor of the class_decl type.
virtual void on_canonical_type_set()
This method is invoked automatically right after the current instance of class_decl has been canonica...
bool has_vtable() const
Test if the current instance has a vtable.
ssize_t get_biggest_vtable_offset() const
Get the highest vtable offset of all the virtual methods of the class.
bool has_virtual_bases() const
Test if the current instance of class_decl has at least one virtual base.
base_specs get_base_specifiers_copy() const
Get a copy of the base specifiers for this class.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
void add_base_specifier(shared_ptr< base_spec > b)
Add a base specifier to this class.
friend var_decl_sptr copy_member_variable(class_decl_sptr t, const var_decl_sptr &variable)
Copy a data member of a class_or_union into a new class_or_union.
const member_functions & get_virtual_mem_fns() const
Get the virtual member functions of this class.
void sort_virtual_mem_fns()
Sort the virtual member functions by their virtual index.
friend bool equals(const class_decl &, const class_decl &, change_kind *)
Compares two instances of class_decl.
virtual bool operator==(const decl_base &) const
Comparison operator for class_decl.
class_decl_sptr find_base_class(const string &qualified_name) const
Find a base class of a given qualified name for the current class.
friend void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
bool has_no_base_nor_member() const
Return true iff the class has no entity in its scope.
vector< base_spec_sptr > base_specs
Convenience typedef.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Getter of the pretty representation of the current instance of class_decl.
The base type of class_decl and union_decl.
virtual size_t get_num_anonymous_member_classes() const
Get the number of anonymous member classes contained in this class.
const var_decl_sptr find_anonymous_data_member(const var_decl_sptr &) const
Find an anonymous data member in the class.
const member_functions & get_member_functions() const
Get the member functions of this class_or_union.
data_members get_data_members_copy() const
Get a copy of the the data members of this class_or_union.
friend void fixup_virtual_member_function(method_decl_sptr method)
When a virtual member function has seen its virtualness set by set_member_function_is_virtual(),...
const member_function_templates & get_member_function_templates() const
Get the member function templates of this class.
virtual size_t get_size_in_bits() const
Getter of the size of the class_or_union type.
virtual size_t get_num_anonymous_member_unions() const
Get the number of anonymous member unions contained in this class.
unordered_map< ssize_t, member_functions > virtual_mem_fn_map_type
Convenience typedef.
friend method_decl_sptr copy_member_function(class_or_union_sptr t, const method_decl *m)
Copy a method of a class_or_union into a new class_or_union.
vector< method_decl_sptr > member_functions
Convenience typedef.
const data_members & get_data_members() const
Get the data members of this class_or_union.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
unordered_map< string, method_decl * > string_mem_fn_ptr_map_type
Convenience typedef.
friend void add_member_class_template(class_or_union_sptr, member_class_template_sptr m)
Append a member class template to the class_or_union.
const method_decl * find_member_function_from_signature(const string &s) const
Find a method (member function) using its signature (pretty representation) as a key.
method_decl_sptr find_member_function_sptr(const string &mangled_name)
Find a method, using its linkage name as a key.
virtual void set_size_in_bits(size_t)
Setter of the size of the class_or_union type.
friend void add_data_member(class_or_union_sptr cou, var_decl_sptr v, access_specifier a, bool is_laid_out, bool is_static, size_t offset_in_bits)
Add a data member to the current instance of class_or_union.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
const data_members & get_non_static_data_members() const
Get the non-static data members of this class_or_union.
const method_decl * find_member_function(const string &mangled_name) const
Find a method, using its linkage name as a key.
const data_members & get_static_data_members() const
Get the static data memebers of this class_or_union.
friend decl_base_sptr insert_member_decl(class_or_union_sptr cou, decl_base_sptr member)
Insert a data member to this class_or_union type.
vector< var_decl_sptr > data_members
Convenience typedef.
virtual ~class_or_union()
Destrcutor of the class_or_union type.
friend decl_base_sptr add_member_decl(class_or_union_sptr cou, decl_base_sptr member_decl)
Add a member declaration to the current instance of class_or_union. The member declaration can be eit...
bool has_no_member() const
friend var_decl_sptr copy_member_variable(class_or_union_sptr t, const var_decl *variable)
Copy a data member of a class_or_union into a new class_or_union.
virtual bool operator==(const decl_base &) const
Equality operator.
friend void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
friend void add_member_function(class_or_union_sptr t, method_decl_sptr f, access_specifier a, bool is_static, bool is_ctor, bool is_dtor, bool is_const)
Add a member function.
virtual size_t get_alignment_in_bits() const
Getter of the alignment of the class_or_union type.
const member_class_templates & get_member_class_templates() const
Get the member class templates of this class.
virtual void set_alignment_in_bits(size_t)
Setter of the alignment of the class type.
vector< type_base_sptr > member_types
Convenience typedef.
virtual size_t get_num_anonymous_member_enums() const
Get the number of anonymous member enums contained in this class.
void maybe_fixup_members_of_anon_data_member(var_decl_sptr anon_dm)
Fixup the members of the type of an anonymous data member.
const var_decl_sptr find_data_member(const string &) const
Find a data member of a given name in the current class_or_union.
friend bool equals(const class_or_union &, const class_or_union &, change_kind *)
Compares two instances of class_or_union.
unordered_map< string, method_decl_sptr > string_mem_fn_sptr_map_type
Convenience typedef.
friend bool remove_member_decl(class_or_union_sptr cou, decl_base_sptr member)
Remove a given decl from the current class_or_union scope.
friend void add_member_function_template(class_or_union_sptr, member_function_template_sptr)
Append a member function template to the class_or_union.
member_functions get_member_functions_copy() const
Get a copy of the member functions of this class_or_union.
Abstract a class template.
friend void set_pattern(class_tdecl_sptr, class_decl_sptr p)
Setter of the pattern of the template.
shared_ptr< class_decl > get_pattern() const
Getter of the pattern of the template.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
virtual bool operator==(const decl_base &) const
Equality operator.
The abstraction of the relationship between an entity and its containing scope (its context)....
bool operator!=(const context_rel &o) const
Inequality operator.
This is the abstraction of a set of translation units (themselves seen as bundles of unitary abi arte...
The base type of all declarations.
void set_definition_of_declaration(const decl_base_sptr &)
Set the definition of this declaration-only decl_base.
void set_is_declaration_only(bool f)
Set a flag saying if the enum_type_decl is a declaration-only enum_type_decl.
virtual bool operator!=(const decl_base &) const
Inequality operator.
void set_qualified_name(const interned_string &) const
Setter for the qualified name.
void set_is_in_public_symbol_table(bool)
Set the flag saying if this decl is from a symbol that is in a public symbols table,...
friend bool get_member_is_static(const decl_base &d)
Gets a flag saying if a class member is static or not.
const decl_base_sptr get_earlier_declaration() const
If this decl_base is a definition, get its earlier declaration.
std::list< typedef_decl_sptr > & get_naming_typedefs() const
Getter for the naming typedef of the current decl.
virtual void set_linkage_name(const string &m)
Setter for the linkage name.
const decl_base * get_naked_definition_of_declaration() const
If this decl_base is declaration-only, get its definition, if any.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Compute the qualified name of the decl.
void clear_qualified_name()
Clear the qualified name of this decl.
virtual void set_name(const string &n)
Setter for the name of the decl.
const location & get_location() const
Get the location of a given declaration.
virtual const interned_string & get_name() const
Getter for the name of the current decl.
const interned_string & peek_qualified_name() const
Getter for the qualified name.
const context_rel * get_context_rel() const
Getter for the context relationship.
scope_decl_sptr get_scope() const
Return the type containing the current decl, if any.
bool get_is_anonymous() const
Test if the current declaration is anonymous.
friend void set_member_is_static(const decl_base_sptr &d, bool s)
Sets the static-ness property of a class member.
virtual const interned_string & get_scoped_name() const
Return the scoped name of the decl.
const decl_base_sptr get_definition_of_declaration() const
If this decl_base is declaration-only, get its definition, if any.
friend void set_member_access_specifier(decl_base &d, access_specifier a)
Sets the access specifier for a class member.
friend void remove_decl_from_scope(decl_base_sptr)
Remove a given decl from its scope.
bool has_naming_typedef(const typedef_decl_sptr)
Test if the current decl has a given naming typedef.
void set_location(const location &l)
Set the location for a given declaration.
void set_is_anonymous(bool)
Set the "is_anonymous" flag of the current declaration.
virtual void set_scope(scope_decl_sptr)
Setter of the scope of the current decl.
void set_visibility(visibility v)
Setter for the visibility of the decl.
void set_temporary_qualified_name(const interned_string &) const
Setter for the temporary qualified name of the current declaration.
visibility get_visibility() const
Getter for the visibility of the decl.
visibility
ELF visibility.
bool get_is_declaration_only() const
Test if a decl_base is a declaration-only decl.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
void set_earlier_declaration(const decl_base_sptr &)
set the earlier declaration of this decl_base definition.
const interned_string & get_linkage_name() const
Getter for the mangled name.
void add_naming_typedef(const typedef_decl_sptr)
Set the naming typedef of the current instance of decl_base.
friend enum access_specifier get_member_access_specifier(const decl_base &d)
Gets the access specifier for a class member.
friend bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
virtual ~decl_base()
Destructor of the decl_base type.
virtual bool operator==(const decl_base &) const
Return true iff the two decls have the same name.
const interned_string & get_qualified_parent_name() const
Return a copy of the qualified name of the parent of the current decl.
bool get_is_anonymous_or_has_anonymous_parent() const
bool get_has_anonymous_parent() const
Get the "has_anonymous_parent" flag of the current declaration.
friend decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl_sptr scpe)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
bool get_is_in_public_symbol_table() const
Test if the decl is defined in a ELF symbol table as a public symbol.
friend bool equals(const decl_base &l, const decl_base &r, change_kind *, bool qualified_name, bool linkage_name)
Compares two instances of decl_base.
const interned_string & peek_temporary_qualified_name() const
Getter of the temporary qualified name of the current declaration.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representatin of the current declaration.
friend bool maybe_compare_as_member_decls(const decl_base &l, const decl_base &r, change_kind *k)
Compare the properties that belong to the "is-a-member-relation" of a decl.
friend bool var_equals_modulo_types(const var_decl &, const var_decl &, change_kind *)
Compares two instances of var_decl without taking their type into account.
The abstraction for a data member context relationship. This relates a data member to its parent clas...
const var_decl_sptr get_anonymous_data_member() const
Return a non-nil value if this data member context relationship has an anonymous data member....
void set_anonymous_data_member(var_decl_sptr)
Set the containing anonymous data member of this data member context relationship....
The abstraction of the version of an ELF symbol.
version & operator=(const version &o)
Assign a version to the current one.
bool operator==(const version &o) const
Compares the current version against another one.
bool is_default() const
Getter for the 'is_default' property of the version.
const string & str() const
Getter for the version name.
bool operator!=(const version &o) const
Inequality operator.
Abstraction of an elf symbol.
const abg_compat::optional< std::string > & get_namespace() const
Getter of the 'namespace' property.
elf_symbol_sptr get_alias_which_equals(const elf_symbol &other) const
In the list of aliases of a given elf symbol, get the alias that equals this current symbol.
elf_symbol_sptr get_next_common_instance() const
Get the next common instance of the current common symbol.
type get_type() const
Getter for the type of the current instance of elf_symbol.
const elf_symbol_sptr get_main_symbol() const
Get the main symbol of an alias chain.
void set_is_in_ksymtab(bool is_in_ksymtab)
Setter of the 'is-in-ksymtab' property.
bool has_aliases() const
Check if the current elf_symbol has an alias.
void set_name(const string &n)
Setter for the name of the current intance of elf_symbol.
bool is_suppressed() const
Getter for the 'is-suppressed' property.
binding
The binding of a symbol.
int get_number_of_aliases() const
Get the number of aliases to this elf symbol.
string get_aliases_id_string(const string_elf_symbols_map_type &symtab, bool include_symbol_itself=true) const
Return a comma separated list of the id of the current symbol as well as the id string of its aliases...
void set_binding(binding b)
Setter for the binding of the current instance of elf_symbol.
void add_common_instance(const elf_symbol_sptr &)
Add a common instance to the current common elf symbol.
void add_alias(const elf_symbol_sptr &)
Add an alias to the current elf symbol.
void set_is_suppressed(bool is_suppressed)
Setter for the 'is-suppressed' property.
bool is_variable() const
Test if the current instance of elf_symbol is a variable symbol or not.
elf_symbol_sptr update_main_symbol(const std::string &)
Update the main symbol for a group of aliased symbols.
void set_size(size_t)
Setter of the size of the symbol.
const string & get_name() const
Getter for the name of the elf_symbol.
binding get_binding() const
Getter for the binding of the current instance of elf_symbol.
static bool get_name_and_version_from_id(const string &id, string &name, string &ver)
Given the ID of a symbol, get the name and the version of said symbol.
bool is_function() const
Test if the current instance of elf_symbol is a function symbol or not.
type
The type of a symbol.
void set_version(const version &v)
Setter for the version of the current instance of elf_symbol.
const abg_compat::optional< uint32_t > & get_crc() const
Getter of the 'crc' property.
void set_visibility(visibility v)
Setter of the visibility of the current instance of elf_symbol.
bool does_alias(const elf_symbol &) const
Test if the current symbol aliases another one.
bool is_main_symbol() const
Tests whether this symbol is the main symbol.
void set_crc(const abg_compat::optional< uint32_t > &crc)
Setter of the 'crc' property.
static elf_symbol_sptr create(const environment &e, size_t i, size_t s, const string &n, type t, binding b, bool d, bool c, const version &ve, visibility vi, bool is_in_ksymtab=false, const abg_compat::optional< uint32_t > &crc={}, const abg_compat::optional< std::string > &ns={}, bool is_suppressed=false)
Factory of instances of elf_symbol.
visibility
The visibility of the symbol.
version & get_version() const
Getter for the version of the current instanc of elf_symbol.
bool is_common_symbol() const
Return true if the symbol is a common one.
void set_index(size_t)
Setter for the index.
visibility get_visibility() const
Getter of the visibility of the current instance of elf_symbol.
bool has_other_common_instances() const
Return true if this common common symbol has other common instances.
size_t get_index() const
Getter for the index.
const string & get_id_string() const
Get a string that is representative of a given elf_symbol.
elf_symbol_sptr get_alias_from_name(const string &name) const
From the aliases of the current symbol, lookup one with a given name.
const environment & get_environment() const
Getter of the environment used by the current instance of elf_symbol.
void set_type(type t)
Setter for the type of the current instance of elf_symbol.
bool is_public() const
Test if the current instance of elf_symbol is public or not.
bool is_in_ksymtab() const
Getter of the 'is-in-ksymtab' property.
size_t get_size() const
Getter of the size of the symbol.
bool is_defined() const
Test if the current instance of elf_symbol is defined or not.
void set_namespace(const abg_compat::optional< std::string > &ns)
Setter of the 'namespace' property.
elf_symbol_sptr get_next_alias() const
Get the next alias of the current symbol.
bool operator==(const elf_symbol &) const
Test if two main symbols are textually equal, or, if they have aliases that are textually equal.
The abstraction of an enumerator.
enumerator()
Default constructor of the enum_type_decl::enumerator type.
bool operator!=(const enumerator &other) const
Inequality operator.
void set_name(const string &n)
Setter for the name of enum_type_decl::enumerator.
enum_type_decl * get_enum_type() const
Getter for the enum type that this enumerator is for.
const string & get_name() const
Getter for the name of the current instance of enum_type_decl::enumerator.
void set_enum_type(enum_type_decl *)
Setter for the enum type that this enumerator is for.
void set_value(int64_t v)
Setter for the value of enum_type_decl::enumerator.
const string & get_qualified_name(bool internal=false) const
Getter for the qualified name of the current instance of enum_type_decl::enumerator....
int64_t get_value() const
Getter for the value of enum_type_decl::enumerator.
bool operator==(const enumerator &other) const
Equality operator.
enumerator & operator=(const enumerator &)
Assignment operator of the enum_type_decl::enumerator type.
Abstracts a declaration for an enum type.
std::vector< enumerator > enumerators
Convenience typedef for a list of enumerator.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual ~enum_type_decl()
Destructor for the enum type declaration.
const enumerators & get_enumerators() const
bool find_enumerator_by_value(int64_t value, enum_type_decl::enumerator &result)
Find an enumerator by its value.
const enumerators & get_sorted_enumerators() const
Get the lexicographically sorted vector of enumerators.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
type_base_sptr get_underlying_type() const
Return the underlying type of the enum.
bool find_enumerator_by_name(const string &name, enum_type_decl::enumerator &result)
Find an enumerator by its name.
virtual bool operator==(const decl_base &) const
Equality operator.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of enum_type_decl.
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
bool decl_only_class_equals_definition() const
Getter of the "decl-only-class-equals-definition" flag.
bool is_void_pointer_type(const type_base_sptr &) const
Test if a given type is the same as the void pointer type of the environment.
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 ...
bool user_set_analyze_exported_interfaces_only() const
Getter for a property that says if the user actually did set the analyze_exported_interfaces_only() p...
const vector< type_base_sptr > * get_canonical_types(const char *name) const
Get the vector of canonical types which have a given "string representation".
const type_base_sptr & get_void_type() const
Get the unique type_decl that represents a "void" type for the current environment....
static size_t get_number_of_threads_to_use()
Getter of the number of threads to use, as set by the user.
bool is_variadic_parameter_type(const type_base *) const
Test if a type is a variadic parameter type as defined in the current environment.
static string & get_variadic_parameter_type_name()
Getter of the name of the variadic parameter type.
const type_base_sptr & get_void_pointer_type() const
Getter of the "pointer-to-void" IR node that is shared across the ABI corpus. This node must be the o...
const config & get_config() const
Getter of the general configuration object.
environment()
Default constructor of the environment type.
type_base * get_canonical_type(const char *name, unsigned index)
Get a given canonical type which has a given "string representation".
const type_base_sptr & get_variadic_parameter_type() const
Get a type_decl instance that represents a the type of a variadic function parameter....
bool is_void_type(const type_base_sptr &) const
Test if a given type is a void type as defined in the current environment.
virtual ~environment()
Destructor for the environment type.
const vector< type_base_sptr > & get_sorted_canonical_types() const
Get the sorted list of canonical types.
interned_string intern(const string &) const
Do intern a string.
static size_t process_thread_pool_size_string(const string &)
Process a thread pool size string and convert it to a numeric value.
friend void keep_type_alive(type_base_sptr)
Make sure that the life time of a given (smart pointer to a) type is the same as the life time of the...
static void set_number_of_threads_to_use(size_t)
Setter of the number of threads to use, as set by the user.
bool analyze_exported_interfaces_only() const
Getter for the property that controls if we are to restrict the analysis to the types that are only r...
canonical_types_map_type & get_canonical_types_map()
Getter the map of canonical types.
Abstraction of a function parameter.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Compute the qualified name of the parameter.
interned_string get_type_name() const
interned_string get_name_id() const
Get a name uniquely identifying the parameter in the function.
const string get_type_pretty_representation() const
virtual bool traverse(ir_node_visitor &v)
Traverse the diff sub-tree under the current instance function_decl.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Compute and return a copy of the pretty representation of the current function parameter.
Abstraction for a function declaration.
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
const function_type_sptr get_type() const
Return the type of the current instance of function_decl.
string get_pretty_representation_of_declarator(bool internal=false) const
Compute and return the pretty representation for the part of the function declaration that starts at ...
const function_type * get_naked_type() const
Fast getter of the type of the current instance of function_decl.
const elf_symbol_sptr get_symbol() const
Gets the the underlying ELF symbol for the current variable, that was set using function_decl::set_sy...
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
void append_parameters(std::vector< parameter_sptr > &parms)
Append a vector of parameters to the type of this function.
bool is_variadic() const
Return true iff the function takes a variable number of parameters.
parameters::const_iterator get_first_non_implicit_parm() const
Getter for the first non-implicit parameter of a function decl.
const type_base_sptr get_return_type() const
function_decl_sptr clone() const
Create a new instance of function_decl that is a clone of the current one.
const std::vector< parameter_sptr > & get_parameters() const
void append_parameter(parameter_sptr parm)
Append a parameter to the type of this function.
void set_symbol(const elf_symbol_sptr &sym)
This sets the underlying ELF symbol for the current function decl.
virtual ~function_decl()
Destructor of the function_decl type.
parameters::const_iterator get_first_non_artificial_parm() const
Get the first parameter of the function that is not compiler-generated.
virtual bool operator==(const decl_base &o) const
Comparison operator for function_decl.
std::vector< parameter_sptr > parameters
Convenience typedef for a vector of parameter_sptr.
bool is_declared_inline() const
Test if the function was declared inline.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of function_decl.
interned_string get_id() const
Return an ID that tries to uniquely identify the function inside a program or a library.
Abstract a function template declaration.
friend void set_pattern(function_tdecl_sptr, function_decl_sptr p)
Set a new pattern to the function template.
binding get_binding() const
Get the binding of the function template.
shared_ptr< function_decl > get_pattern() const
Get the pattern of the function template.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
virtual bool operator==(const decl_base &) const
Comparison operator for the function_tdecl type.
Abstraction of a function type.
shared_ptr< function_decl::parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
unsigned get_nb_parameters() const
The number of parameters of the function type in a thread-safe manner.
bool has_empty_parameters() const
Test if a the function type has empty parameters in a thread-safe manner.
const parameter_sptr get_parm_at(size_t) const
Get the function parameter at a given index, starting from zero.
friend bool equals(const function_type &, const function_type &, change_kind *)
Compare two function types.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &)
Traverses an instance of function_type, visiting all the sub-types and decls that it might contain.
bool is_variadic() const
Test if the current instance of function_type is for a variadic function.
parameters::const_iterator get_first_parm() const
Get the first parameter of the function.
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
virtual bool operator==(const type_base &) const
Equality operator for function_type.
void append_parameter(parameter_sptr parm)
Append a new parameter to the vector of parameters of the current instance of function_type.
void set_parameters(const parameters &p)
Setter for the parameters of the current instance of function_type.
const interned_string & get_cached_name(bool internal=false) const
Get the name of the current function_type.
const parameter_sptr get_parm_at_index_from_first_non_implicit_parm(size_t) const
Get the Ith parameter of the vector of parameters of the current instance of function_type.
type_base_sptr get_return_type() const
Getter for the return type of the current instance of function_type.
void set_return_type(type_base_sptr t)
Setter of the return type of the current instance of function_type.
parameters::const_iterator get_first_non_implicit_parm() const
Get the first parameter of the function.
const parameters & get_parameters() const
Getter for the set of parameters of the current intance of function_type.
std::vector< parameter_sptr > parameters
Convenience typedef for a vector of parameter_sptr.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Return a copy of the pretty representation of the current function_type.
parameters::const_iterator get_first_non_artificial_parm() const
Get the first parameter of the function that is not compiler-generated.
This abstracts the global scope of a given translation unit.
The base class for the visitor type hierarchy used for traversing a translation unit.
bool allow_visiting_already_visited_type_node() const
Get if the walker using this visitor is allowed to re-visit a type node that was previously visited o...
bool type_node_has_been_visited(type_base *) const
Test if a given type node has been marked as visited.
void forget_visited_type_nodes()
Un-mark all visited type nodes.
bool allow_visiting_member_type_nodes() const
Get if the walker using this visitor is allowed to visit member type nodes.
ir_node_visitor()
Default Constructor of the ir_node_visitor type.
void mark_type_node_as_visited(type_base *)
Mark a given type node as having been visited.
The entry point to manage locations.
location create_new_location(const std::string &fle, size_t lne, size_t col)
Insert the triplet representing a source locus into our internal vector of location triplet....
void expand_location(const location &location, std::string &path, unsigned &line, unsigned &column) const
Given an instance of location type, return the triplet {path,line,column} that represents the source ...
The source location of a token.
void set_artificial(size_t v)
Set the artificial-ness of the location.
location()
Default constructor for the location type.
bool get_is_artificial() const
Test if the location is artificial.
bool operator<(const location &other) const
"Less than" operator of the location type.
location & operator=(const location &l)
Assignment operator of the location.
bool operator==(const location &other) const
Equality operator of the location type.
unsigned get_value() const
Get the value of the location.
string expand(void) const
Expand the location into a string.
Abstraction of a member function context relationship. This relates a member function to its parent c...
bool is_constructor() const
Getter for the 'is-constructor' property.
bool is_const() const
Getter for the 'is-const' property.
size_t vtable_offset() const
Getter for the vtable offset property.
bool is_destructor() const
Getter for the 'is-destructor' property.
The base class for member types, data members and member functions. Its purpose is mainly to carry th...
access_specifier get_access_specifier() const
Getter for the access specifier of this member.
bool get_is_static() const
void set_access_specifier(access_specifier a)
Setter for the access specifier of this member.
void set_is_static(bool f)
Set a flag saying if the parameter is static or not.
Abstracts a member class template template.
virtual bool operator==(const member_base &o) const
Equality operator of the the member_class_template class.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Abstract a member function template.
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Abstraction of the declaration of a method.
friend void set_member_function_is_const(function_decl &, bool)
set the const-ness property of a member function.
virtual void set_linkage_name(const string &)
Set the linkage name of the method.
friend void set_member_function_is_ctor(function_decl &, bool)
Setter for the is_ctor property of the member function.
friend ssize_t get_member_function_vtable_offset(const function_decl &)
Get the vtable offset of a member function.
friend bool get_member_function_is_ctor(const function_decl &)
Test whether a member function is a constructor.
friend void set_member_function_is_dtor(function_decl &, bool)
Set the destructor-ness property of a member function.
const method_type_sptr get_type() const
friend bool member_function_has_vtable_offset(const function_decl &)
Test if a virtual member function has a vtable offset set.
friend bool get_member_function_is_dtor(const function_decl &)
Test whether a member function is a destructor.
friend bool get_member_function_is_const(const function_decl &)
Test whether a member function is const.
Abstracts the type of a class member function.
void set_class_type(const class_or_union_sptr &t)
Sets the class type of the current instance of method_type.
bool get_is_static() const
Fetter of the "is-static" property of method_type.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
void set_is_const(bool)
Setter of the "is-const" property of method_type.
virtual bool traverse(ir_node_visitor &)
Traverses an instance of method_type, visiting all the sub-types and decls that it might contain.
bool get_is_for_static_method() const
Test if the current method type is for a static method or not.
void set_is_static(bool)
Setter of the "is-static" property of method_type.
friend interned_string get_method_type_name(const method_type &fn_type, bool internal)
Get the name of a given method type and return a copy of it.
virtual ~method_type()
The destructor of method_type.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Return a copy of the pretty representation of the current method_type.
class_or_union_sptr get_class_type() const
Get the class type this method belongs to.
bool get_is_const() const
Getter of the "is-const" property of method_type.
The abstraction of a namespace declaration.
bool is_empty_or_has_empty_sub_namespaces() const
Test if the current namespace_decl is empty or contains empty namespaces itself.
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
virtual bool operator==(const decl_base &) const
Return true iff both namespaces and their members are equal.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build and return a copy of the pretty representation of the namespace.
Abstracts non type template parameters.
const type_base_sptr get_type() const
Getter for the type of the template parameter.
virtual bool operator==(const decl_base &) const
Return true iff the two decls have the same name.
The abstraction of a pointer type.
void set_pointed_to_type(const type_base_sptr &)
Set the pointed-to type of the pointer.
virtual void get_qualified_name(interned_string &, bool internal=false) const
Build and return the qualified name of the current instance of pointer_type_def.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
virtual bool operator==(const decl_base &) const
Return true iff both instances of pointer_type_def are equal.
const type_base_sptr get_pointed_to_type() const
Getter of the pointed-to type.
type_base * get_naked_pointed_to_type() const
Getter of a naked pointer to the pointed-to type.
The abstraction of a pointer-to-member type.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Get the qualified name for the current ptr_to_mbr_type.
virtual const interned_string & get_name() const
Getter of the name of the current ptr-to-mbr-type.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
const type_base_sptr & get_containing_type() const
Getter of the type containing the member pointed-to by the current ptr_to_mbr_type.
bool operator==(const ptr_to_mbr_type &) const
Equality operator for the current ptr_to_mbr_type.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function for ptr_to_mbr_type.
const type_base_sptr & get_member_type() const
Getter of the member type of the current ptr_to_mbr_type.
virtual ~ptr_to_mbr_type()
Desctructor for ptr_to_mbr_type.
The abstraction of a qualified type.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Implementation for the virtual qualified name builder for qualified_type_def.
void set_underlying_type(const type_base_sptr &)
Setter of the underlying type.
virtual size_t get_size_in_bits() const
Get the size of the qualified type def.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
string get_cv_quals_string_prefix() const
Compute and return the string prefix or suffix representing the qualifiers hold by the current instan...
CV
Bit field values representing the cv qualifiers of the underlying type.
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
void set_cv_quals(CV cv_quals)
Setter of the const/value qualifiers bit field.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
CV get_cv_quals() const
Getter of the const/volatile qualifier bit field.
type_base_sptr get_underlying_type() const
Getter of the underlying type.
virtual bool operator==(const decl_base &) const
Equality operator for qualified types.
string build_name(bool, bool internal=false) const
Build the name of the current instance of qualified type.
Abstracts a reference type.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Build and return the qualified name of the current instance of the reference_type_def.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
void set_pointed_to_type(type_base_sptr &pointed_to_type)
Setter of the pointed_to type of the current reference type.
virtual bool operator==(const decl_base &) const
Equality operator of the reference_type_def type.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of reference_type_def.
A declaration that introduces a scope.
friend decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl_sptr scope)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
virtual size_t get_num_anonymous_member_classes() const
Getter for the number of anonymous classes contained in this scope.
friend void add_member_type(scope_decl_sptr scope, type_base_sptr t)
Add a member type to a given scope.
friend bool remove_member_decl(scope_decl_sptr scope, decl_base_sptr member)
Remove a declaration from the current scope.
friend void remove_decl_from_scope(decl_base_sptr decl)
Remove a given decl from its scope.
virtual size_t get_num_anonymous_member_unions() const
Getter for the number of anonymous unions contained in this scope.
friend decl_base_sptr add_member_decl(scope_decl_sptr scope, decl_base_sptr member)
Add a member decl to this scope. Note that user code should not use this, but rather use add_decl_to_...
scopes & get_member_scopes()
Getter for the scopes carried by the current scope.
friend decl_base_sptr insert_decl_into_scope(decl_base_sptr decl, scope_decl::declarations::iterator before, scope_decl_sptr scope)
Inserts a declaration into a given scope, before a given IR child node of the scope.
declarations get_member_decls_copy() const
Getter for a copy of the member declarations carried by the current scope_decl.
std::vector< scope_decl_sptr > scopes
Convenience typedef for a vector of scope_decl_sptr.
bool is_empty() const
Test if the current scope is empty.
type_base_sptrs_type get_sorted_member_types_copy() const
Get a copy of the sorted member types.
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
const type_base_sptrs_type & get_member_types() const
Get the member types of this scope_decl.
bool remove_member_type(type_base_sptr t)
Remove a member type from the current class_or_union scope.
std::vector< function_type_sptr > function_types
Convenience typedef for a vector of function_type_sptr.
std::vector< decl_base_sptr > declarations
Convenience typedef for a vector of decl_base_sptr.
const type_base_sptrs_type & get_sorted_canonical_types() const
Return a vector of sorted canonical types of the current scope.
bool find_iterator_for_member(const decl_base *, declarations::iterator &)
Find a member of the current scope and return an iterator on it.
type_base_sptr find_member_type(const string &name) const
Find a member type of a given name, inside the current scope_decl.
const declarations & get_member_decls() const
Getter for the member declarations carried by the current scope_decl.
const canonical_type_sptr_set_type & get_canonical_types() const
@eturn the set of canonical types of the the current scope.
const type_base_sptrs_type & get_sorted_member_types() const
Get the sorted member types of this scope_decl.
virtual bool operator==(const decl_base &) const
Return true iff both scopes have the same names and have the same member decls.
const declarations & get_sorted_member_decls() const
Getter for the sorted member declarations carried by the current scope_decl.
virtual size_t get_num_anonymous_member_enums() const
Getter for the number of anonymous enums contained in this scope.
A type that introduces a scope.
virtual bool traverse(ir_node_visitor &)
Traverses an instance of scope_type_decl, visiting all the sub-types and decls that it might contain.
virtual bool operator==(const decl_base &) const
Equality operator between two scope_type_decl.
The base class of templates.
const std::list< template_parameter_sptr > & get_template_parameters() const
Get the list of template parameters of the current instance of template_decl.
virtual ~template_decl()
Destructor.
void add_template_parameter(const template_parameter_sptr p)
Add a new template parameter to the current instance of template_decl.
virtual bool operator==(const decl_base &o) const
Equality operator.
Base class for a template parameter. Client code should use the more specialized type_template_parame...
virtual ~template_parameter()
Destructor.
bool operator!=(const template_parameter &) const
Inequality operator.
Abstracts a template template parameter.
virtual bool operator==(const type_base &) const
Equality operator.
This is the abstraction of the set of relevant artefacts (types, variable declarations,...
const scope_decl_sptr get_global_scope() const
Getter of the the global scope of the translation unit.
void set_address_size(char)
Setter of the address size in this translation unit.
const type_sptr_set_type & get_live_fn_types() const
Get the vector of function types that are used in the current translation unit.
const std::string & get_absolute_path() const
Get the concatenation of the build directory and the relative path of the translation unit.
void set_is_constructed(bool)
Setter of the 'is_constructed" flag. It says if the translation unit is fully constructed or not.
bool operator==(const translation_unit &) const
Compare the current translation unit against another one.
const corpus * get_corpus() const
Get the corpus this translation unit is a member of.
char get_address_size() const
Getter of the address size in this translation unit.
const std::string & get_compilation_dir_path() const
Get the path of the directory that was 'current' when the translation unit was compiled.
friend 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_corpus(corpus *)
Set the corpus this translation unit is a member of.
void set_language(language l)
Setter of the language of the source code of the translation unit.
void bind_function_type_life_time(function_type_sptr) const
Ensure that the life time of a function type is bound to the life time of the current translation uni...
bool is_empty() const
Tests whether if the current translation unit contains ABI artifacts or not.
bool is_constructed() const
Getter of the 'is_constructed" flag. It says if the translation unit is fully constructed or not.
friend 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...
const std::string & get_path() const
Get the path of the current translation unit.
void set_compilation_dir_path(const std::string &)
Set the path of the directory that was 'current' when the translation unit was compiled.
location_manager & get_loc_mgr()
Getter of the location manager for the current translation unit.
void set_path(const string &)
Set the path associated to the current instance of translation_unit.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse virtual function.
language
The language of the translation unit.
shared_ptr< scope_decl > global_scope_sptr
Convenience typedef for a shared pointer on a global_scope.
bool operator!=(const translation_unit &) const
Inequality operator.
const environment & get_environment() const
Getter of the environment of the current translation_unit.
const type_maps & get_types() const
Getter of the types of the current translation_unit.
language get_language() const
Getter of the language of the source code of the translation unit.
The interface for types which are feeling social and want to be visited during the traversal of a hie...
An abstraction helper for type declarations.
type_base * get_naked_canonical_type() const
Getter of the canonical type pointer.
virtual size_t get_size_in_bits() const
Getter for the size of the type.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &)
Default implementation of traversal for types. This function does nothing. It must be implemented by ...
virtual void on_canonical_type_set()
This method is invoked automatically right after the current instance of class_decl has been canonica...
virtual void set_size_in_bits(size_t)
Setter for the size of the type.
virtual bool operator!=(const type_base &) const
Inequality operator.
virtual bool operator==(const type_base &) const
Return true iff both type declarations are equal.
virtual size_t get_alignment_in_bits() const
Getter for the alignment of the type.
virtual void set_alignment_in_bits(size_t)
Setter for the alignment of the type.
type_base_sptr get_canonical_type() const
Getter of the canonical type of the current instance of type_base.
This abstracts a composition of types based on template type parameters. The result of the compositio...
const type_base_sptr get_composed_type() const
Getter for the resulting composed type.
void set_composed_type(type_base_sptr t)
Setter for the resulting composed type.
A basic type declaration that introduces no scope.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Implementation for the virtual qualified name builder for type_decl.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
virtual bool operator!=(const type_base &) const
Return true if both types equals.
virtual bool operator==(const type_base &) const
Return true if both types equals.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of type_decl.
This is a type that aggregates maps of all the kinds of types that are supported by libabigail.
istring_type_base_wptrs_map_type & typedef_types()
Getter for the map that associates the name of a typedef to the vector of instances of typedef_decl_s...
istring_type_base_wptrs_map_type & function_types()
Getter for the map that associates the name of a function type to the vector of instances of function...
istring_type_base_wptrs_map_type & reference_types()
Getter for the map that associates the name of a reference type to the vector of instances of referen...
const istring_type_base_wptrs_map_type & class_types() const
Getter for the map that associates the name of a class type to the vector of instances of class_decl_...
istring_type_base_wptrs_map_type & union_types()
Getter for the map that associates the name of a union type to the vector of instances of union_decl_...
istring_type_base_wptrs_map_type & array_types()
Getter for the map that associates the name of an array type to the vector of instances of array_type...
istring_type_base_wptrs_map_type & enum_types()
Getter for the map that associates the name of an enum type to the vector of instances of enum_type_d...
bool empty() const
Test if the type_maps is empty.
istring_type_base_wptrs_map_type & qualified_types()
Getter for the map that associates the name of a qualified type to the vector of instances of qualifi...
istring_type_base_wptrs_map_type & ptr_to_mbr_types()
Getter for the map that associates the name of a pointer-to-member type to the vector of instances of...
istring_type_base_wptrs_map_type & pointer_types()
Getter for the map that associates the name of a pointer type to the vector of instances of pointer_t...
const istring_type_base_wptrs_map_type & basic_types() const
Getter for the map that associates the name of a basic type to the vector instances of type_decl_sptr...
const vector< type_base_wptr > & get_types_sorted() const
Getter of all types types sorted by their pretty representation.
const istring_type_base_wptrs_map_type & subrange_types() const
Getter for the map that associates the name of a subrange type to the vector of instances of array_ty...
The base class of both types and declarations.
void set_translation_unit(translation_unit *)
Set the translation_unit this ABI artifact belongs to.
const interned_string & get_cached_pretty_representation(bool internal=false) const
Get the pretty representation of the current decl.
bool get_is_artificial() const
Getter of the flag that says if the artefact is artificial.
virtual ~type_or_decl_base()
The destructor of the type_or_decl_base type.
location & get_artificial_location() const
Getter of the artificial location of the artifact.
bool has_artificial_location() const
Test if the current ABI artifact carries an artificial location.
std::recursive_mutex & get_mutex() const
Get the recursive mutex associated to the artifact.
friend type_or_decl_base::type_or_decl_kind & operator|=(type_or_decl_base::type_or_decl_kind &, type_or_decl_base::type_or_decl_kind)
bitwise "|=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
const corpus * get_corpus() const
Get the corpus this ABI artifact belongs to.
friend hash_t set_or_get_cached_hash_value(const T &type_or_decl)
Set the hash value of an IR node and return it.
offset_t get_native_offset() const
Get the native offset of a given artifact.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
enum type_or_decl_kind kind() const
Getter for the "kind" property of type_or_decl_base type.
void set_is_artificial(bool)
Setter of the flag that says if the artefact is artificial.
virtual bool traverse(ir_node_visitor &)
Traverse the the ABI artifact.
const void * runtime_type_instance() const
Getter of the pointer to the runtime type sub-object of the current instance.
friend class_decl * is_class_type(const type_or_decl_base *)
Test whether a type is a class.
void set_native_offset(const offset_t)
Set the native offset of a given artifact.
friend type_or_decl_base::type_or_decl_kind & operator&=(type_or_decl_base::type_or_decl_kind &, type_or_decl_base::type_or_decl_kind)
bitwise "A&=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
void set_original_artefact(const type_or_decl_base *)
Set the original artefact that the current artefact was copied from.
const type_or_decl_base * get_original_artefact() const
Get the original artefact that the current artefact was copied from.
void set_corpus(corpus *) const
Set the ABI corpus associated to the current ABI artifact.
friend hash_t peek_hash_value(const type_or_decl_base &)
Get the hash value associated to an IR node.
const void * type_or_decl_base_pointer() const
Getter of the pointer to either the type_base sub-object of the current instance if it's a type,...
friend decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
void set_artificial_location(const location &)
Setter of the artificial location of the artificat.
type_or_decl_kind
This is a bitmap type which instance is meant to contain the runtime type of a given ABI artifact....
const environment & get_environment() const
Getter of the environment of the current ABI artifact.
friend type_or_decl_base::type_or_decl_kind operator|(type_or_decl_base::type_or_decl_kind, type_or_decl_base::type_or_decl_kind)
bitwise "OR" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
friend hash_t get_subtype_hash(const type_or_decl_base *t)
Compute (or get) the hash of a sub-type of the type for which we are currently computing the hash....
friend type_or_decl_base::type_or_decl_kind operator&(type_or_decl_base::type_or_decl_kind, type_or_decl_base::type_or_decl_kind)
bitwise "AND" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
friend type_base * is_type(const type_or_decl_base *)
Test whether a declaration is a type.
const translation_unit * get_translation_unit() const
Get the translation_unit this ABI artifact belongs to.
Abstracts a type template parameter.
virtual bool operator==(const type_base &) const
Equality operator.
The abstraction of a typedef declaration.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Implementation of the virtual "get_qualified_name" method.
void set_underlying_type(const type_base_sptr &)
Setter ofthe underlying type of the typedef.
virtual size_t get_size_in_bits() const
Return the size of the typedef.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
type_base_sptr get_underlying_type() const
Getter of the underlying type of the typedef.
virtual bool operator==(const decl_base &) const
Equality operator.
virtual size_t get_alignment_in_bits() const
Return the alignment of the typedef.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build a pretty representation for a typedef_decl.
Abstracts a union type declaration.
virtual hash_t hash_value() const
Return the hash value of the current IR node.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
virtual bool operator==(const decl_base &) const
Comparison operator for union_decl.
virtual ~union_decl()
Destructor of the union_decl type.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Getter of the pretty representation of the current instance of union_decl.
Abstracts a variable declaration.
binding get_binding() const
Getter of the binding of the variable.
void set_type(type_base_sptr &)
Setter of the type of the variable.
void set_binding(binding b)
Setter of the binding of the variable.
friend uint64_t get_data_member_offset(const var_decl_sptr m)
Get the offset of a data member.
var_decl_sptr clone() const
Create a new var_decl that is a clone of the current one.
virtual const interned_string & get_qualified_name(bool internal=false) const
Get the qualified name of a given variable or data member.
const elf_symbol_sptr get_symbol() const
Gets the the underlying ELF symbol for the current variable, that was set using var_decl::set_symbol(...
const type_base * get_naked_type() const
Getter of the type of the variable.
friend bool get_data_member_is_laid_out(const var_decl &m)
Test whether a data member is laid out.
const type_base_sptr get_type() const
Getter of the type of the variable.
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
string get_anon_dm_reliable_name(bool qualified=true) const
Get a name that is valid even for an anonymous data member.
friend uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
void set_symbol(const elf_symbol_sptr &sym)
Sets the underlying ELF symbol for the current variable.
friend void set_data_member_offset(var_decl_sptr m, uint64_t o)
Set the offset of a data member into its containing class.
friend void set_data_member_is_laid_out(var_decl_sptr m, bool l)
Set a flag saying if a data member is laid out.
virtual bool operator==(const decl_base &) const
Comparison operator of var_decl.
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build and return the pretty representation of this variable.
interned_string get_id() const
Return an ID that tries to uniquely identify the variable inside a program or a library.
real_type::modifiers_type operator~(real_type::modifiers_type l)
Bitwise one's complement operator for real_type::modifiers_type.
shared_ptr< reference_type_def > reference_type_def_sptr
Convenience typedef for a shared pointer on a reference_type_def.
hash_t peek_hash_value(const type_or_decl_base &artefact)
Get the hash value associated to an IR node.
shared_ptr< method_type > method_type_sptr
Convenience typedef for shared pointer to method_type.
unordered_map< string, type_base_sptr > string_type_base_sptr_map_type
A convenience typedef for a map which key is a string and which value is a type_base_sptr.
bool equals(const decl_base &l, const decl_base &r, change_kind *k, bool qualified_name, bool linkage_name)
Compares two instances of decl_base.
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
access_specifier
Access specifier for class members.
bool function_decls_alias(const function_decl &f1, const function_decl &f2)
Test if two function declarations are aliases.
shared_ptr< class_tdecl > class_tdecl_sptr
Convenience typedef for a shared pointer on a class_tdecl.
corpus::origin operator|=(corpus::origin &l, corpus::origin r)
Bitwise |= operator for the corpus::origin type.
void fixup_virtual_member_function(method_decl_sptr method)
When a virtual member function has seen its virtualness set by set_member_function_is_virtual(),...
bool equals_modulo_cv_qualifier(const array_type_def *l, const array_type_def *r)
Test if two array types are equals modulo CV qualifiers.
unordered_set< type_or_decl_base_sptr, type_or_decl_hash, type_or_decl_equal > artifact_sptr_set_type
A convenience typedef for a hash set of type_or_decl_base_sptr.
string translation_unit_language_to_string(translation_unit::language l)
Converts a translation_unit::language enumerator into a string.
weak_ptr< type_base > type_base_wptr
Convenience typedef for a weak pointer on a type_base.
class_decl::base_spec * is_class_base_spec(const type_or_decl_base *tod)
Test if an ABI artifact is a class base specifier.
array_type_def::subrange_type * is_subrange_type(const type_or_decl_base *type)
Test if a type is an array_type_def::subrange_type.
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
unordered_set< const type_or_decl_base *, type_or_decl_hash, type_or_decl_equal > artifact_ptr_set_type
A convenience typedef for a hash set of const type_or_decl_base*.
change_kind
A bitfield that gives callers of abigail::ir::equals() some insight about how different two internal ...
@ LOCAL_TYPE_CHANGE_KIND
This means that a given IR artifact has a local type change.
@ SUBTYPE_CHANGE_KIND
This means that a given IR artifact has changes in some of its sub-types, with respect to the other a...
@ ALL_LOCAL_CHANGES_MASK
Testing (anding) against this mask means that a given IR artifact has local differences,...
@ LOCAL_NON_TYPE_CHANGE_KIND
This means that a given IR artifact has a local non-type change. That is a change that is carried by ...
abg_compat::optional< uint64_t > offset_t
The abstraction for a native offset.
bool operator==(const translation_unit_sptr &l, const translation_unit_sptr &r)
A deep comparison operator for pointers to translation units.
vector< type_base_sptr > type_base_sptrs_type
Helper typedef for a vector of shared pointer to a type_base.
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
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...
std::vector< elf_symbol_sptr > elf_symbols
Convenience typedef for a vector of elf_symbol.
shared_ptr< template_parameter > template_parameter_sptr
Convenience typedef for shared pointer to template parameter.
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
bool string_to_elf_symbol_type(const string &s, elf_symbol::type &t)
Convert a string representing a symbol type into an elf_symbol::type.
void fns_to_str(vector< function_decl * >::const_iterator a_begin, vector< function_decl * >::const_iterator a_end, vector< function_decl * >::const_iterator b_begin, vector< function_decl * >::const_iterator b_end, std::ostream &o)
For each sequence of functions given in argument, generate a sequence of string that matches a given ...
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.
void set_member_access_specifier(decl_base &d, access_specifier a)
Sets the access specifier for a class member.
abg_compat::optional< uint64_t > hash_t
The abstraction for an 8 bytes hash value.
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.
std::ostream & operator<<(std::ostream &o, elf_symbol::type t)
Serialize an instance of symbol_type and stream it to a given output stream.
bool var_equals_modulo_types(const var_decl &l, const var_decl &r, change_kind *k)
Compares two instances of var_decl without taking their type into account.
corpus::origin operator|(corpus::origin l, corpus::origin r)
Bitwise | operator for the corpus::origin type.
bool elf_symbol_is_function(elf_symbol::type t)
Test if the type of an ELF symbol denotes a function symbol.
bool is_cplus_plus_language(translation_unit::language l)
Test if a language enumerator designates the C++ language.
std::unordered_map< string, elf_symbol_sptr > string_elf_symbol_sptr_map_type
Convenience typedef for a map which key is a string and which value if the elf symbol of the same nam...
void perform_type_canonicalization(vector< type_base_sptr > &types, bool do_log, bool show_stats)
Hash and canonicalize a sequence of types.
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 ...
bool elf_symbols_alias(const elf_symbol &s1, const elf_symbol &s2)
Test if two symbols alias.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
method_decl_sptr copy_member_function(class_or_union_sptr t, const method_decl_sptr &method)
Copy a method of a class_or_union into a new class_or_union.
bool enum_equals_modulo_name(const enum_type_decl &l, const enum_type_decl &r, change_kind *k)
Test if two enums are equal modulo their names. That is, the test compares the two enums as if they d...
corpus::origin operator&(corpus::origin l, corpus::origin r)
Bitwise & operator for the corpus::origin type.
void move_member_type(decl_base_sptr member_type, scope_decl_sptr new_scope)
Move a member type of a scope_decl to another scope_decl.
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
bool string_to_elf_symbol_binding(const string &s, elf_symbol::binding &b)
Convert a string representing a an elf symbol binding into an elf_symbol::binding.
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
shared_ptr< string_elf_symbols_map_type > string_elf_symbols_map_sptr
Convenience typedef for a shared pointer to string_elf_symbols_map_type.
shared_ptr< context_rel > context_rel_sptr
A convenience typedef for shared pointers to context_rel.
shared_ptr< string_elf_symbol_sptr_map_type > string_elf_symbol_sptr_map_sptr
Convenience typedef for a shared pointer to an string_elf_symbol_sptr_map_type.
qualified_type_def_sptr lookup_qualified_type(const interned_string &type_name, const translation_unit &tu)
Lookup a qualified type from a translation unit.
bool is_java_language(translation_unit::language l)
Test if a language enumerator designates the Java language.
function_decl::parameter * is_function_parameter(const type_or_decl_base *tod)
Test whether a declaration is a function_decl.
bool string_to_elf_symbol_visibility(const string &s, elf_symbol::visibility &v)
Convert a string representing a an elf symbol visibility into an elf_symbol::visibility.
weak_ptr< elf_symbol > elf_symbol_wptr
A convenience typedef for a weak pointer to elf_symbol.
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
bool is_enumerator_present_in_enum(const enum_type_decl::enumerator &enr, const enum_type_decl &enom)
Test if a given enumerator is found present in an enum.
translation_unit::language string_to_translation_unit_language(const string &l)
Parse a string representing a language into a translation_unit::language enumerator into a string.
const function_decl::parameter * get_function_parameter(const decl_base *fun, unsigned parm_index)
Get the function parameter designated by its index.
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
bool is_c_language(translation_unit::language l)
Test if a language enumerator designates the C language.
method_decl * is_method_decl(const type_or_decl_base *d)
Test if a function_decl is actually a method_decl.
access_specifier get_member_access_specifier(const decl_base &d)
Gets the access specifier for a class member.
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
vector< type_base * > type_base_ptrs_type
Helper typedef for a vector of pointer to type_base.
unordered_set< uintptr_t > pointer_set
A convenience typedef for an unordered set of pointer values.
unordered_map< interned_string, type_base_wptr, hash_interned_string > istring_type_base_wptr_map_type
A convenience typedef for a map which key is an interned_string and which value is a type_base_wptr.
vector< namespace_decl_sptr > namespaces_type
A convenience typedef for vectors of namespace_decl_sptr.
void sort_types(IteratorType begin, IteratorType end, SortingFunctorType comp, bool do_log=false)
Sort types.
interned_string get_name_of_qualified_type(const type_base_sptr &underlying_type, qualified_type_def::CV quals, bool qualified, bool internal)
Get the name of a qualified type, given the underlying type and its qualifiers.
shared_ptr< template_decl > template_decl_sptr
Convenience typedef for a shared pointer to template_decl.
string get_string_representation_of_cv_quals(const qualified_type_def::CV cv_quals)
Get the string representation of a CV qualifier bitmap.
unordered_set< type_base_sptr, shallow_type_hasher, shallow_type_eq > type_sptr_set_type
Convenience typedef for a set of type_base_sptr.
std::set< translation_unit_sptr, shared_translation_unit_comp > translation_units
Convenience typedef for an ordered set of translation_unit_sptr.
const var_decl * lookup_data_member(const type_base *type, const char *dm_name)
Look for a data member of a given class, struct or union type and return it.
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
unordered_set< type_base_wptr, shallow_type_hasher, shallow_type_eq > type_wptr_set_type
Convenience typedef for a set of type_base_wptr.
unordered_set< type_base_sptr, canonical_type_hash > canonical_type_sptr_set_type
Helper typedef for an unordered set of type_base_sptr which uses pointer value to tell its members ap...
bool is_ada_language(translation_unit::language l)
Test if a language enumerator designates the Ada language.
unordered_map< interned_string, type_or_decl_base_sptr, hash_interned_string > istring_type_or_decl_base_sptr_map_type
A convenience typedef for a map which key is an interned_string and which value is a type_base_wptr.
corpus::origin operator&=(corpus::origin &l, corpus::origin r)
Bitwise &= operator for the corpus::origin type.
bool operator!=(const translation_unit_sptr &l, const translation_unit_sptr &r)
A deep inequality operator for pointers to translation units.
function_decl * is_function_decl(const type_or_decl_base *d)
Test whether a declaration is a function_decl.
bool elf_symbol_is_variable(elf_symbol::type t)
Test if the type of an ELF symbol denotes a function symbol.
std::unordered_map< string, elf_symbols > string_elf_symbols_map_type
Convenience typedef for a map which key is a string and which value is a vector of elf_symbol.
unordered_set< type_base *, canonical_type_hash > canonical_type_ptr_set_type
Helper typedef for an unordered set of type_base* which uses pointer value to tell its members appart...
shared_ptr< function_tdecl > function_tdecl_sptr
Convenience typedef for a shared pointer on a function_tdecl.
unordered_map< string, type_base_wptr > string_type_base_wptr_map_type
A convenience typedef for a map which key is a string and which value is a type_base_wptr.
bool maybe_compare_as_member_decls(const decl_base &l, const decl_base &r, change_kind *k)
Compare the properties that belong to the "is-a-member-relation" of a decl.
Toplevel namespace for libabigail.
bool operator==(const std::string &l, const interned_string &r)
Equality operator.
A functor to hash instances of interned_string.
Hash functor for instances of array_type_def::hash.
Hash functor for instances of array_type_def::subrange_type.
Functor to hash a canonical type by using its pointer value.
size_t operator()(const type_base_sptr &l) const
Hash a type by returning the pointer value of its canonical type.
The hashing functor for class_decl::base_spec.
Hasher for the class_decl type.
The private data for the class_decl type.
Hasher for the class_or_union type.
Hash functor for instances of enum_type_decl.
The private data of the environment type.
Equality functor for instances of function_decl.
bool operator()(const function_decl *l, const function_decl *r) const
Tests if two pointers to function_decl are equal.
The hashing functor for function_type.
The type of the private data of the function_type type.
The base of an entity of the intermediate representation that is to be traversed.
virtual bool traverse(ir_node_visitor &v)
Traverse a given IR node and its children, calling an visitor on each node.
The hashing functor for member_base.
Hashing functor for the method_type type.
The base class for the visitor type hierarchy used for traversing a hierarchy of nodes.
Hash functor for instances of pointer_type_def.
Hash functor for instances of ptr_to_mbr_type.
Hash functor for instances of qualified_type_def.
Hash functor for instances of reference_type_def.
An equality functor for type_base_sptr that only compares their pointer values and does not do any de...
bool operator()(const type_base_sptr &l, const type_base_sptr &r) const
The equality operator.
A hashing functor for type_base_sptr that doesn't do any deep type comparison but rather just compare...
uint64_t operator()(const type_base_sptr &t) const
The hashing operator of a type_base_sptr.
A comparison functor to compare translation units based on their absolute paths.
bool operator()(const translation_unit_sptr &lhs, const translation_unit_sptr &rhs) const
Compare two translations units based on their absolute paths.
Private type to hold private members of translation_unit.
Hash functor for instances of type_base.
Definition of the private data of type_base.
Hash functor for instances of type_decl.
A comparison functor to compare pointer to instances of type_or_decl_base.
bool operator()(const type_or_decl_base_sptr &f, const type_or_decl_base_sptr &s)
Comparison operator for ABI artifacts.
bool operator()(const type_or_decl_base *f, const type_or_decl_base *s)
Comparison operator for ABI artifacts.
The comparison functor for using instances of type_or_decl_base as values in a hash map or set.
bool operator()(const type_or_decl_base_sptr &l, const type_or_decl_base_sptr &r) const
The function-call operator to compare the string representations of two ABI artifacts.
bool operator()(const type_or_decl_base *l, const type_or_decl_base *r) const
The function-call operator to compare the string representations of two ABI artifacts.
The hashing functor for using instances of type_or_decl_base as values in a hash map or set.
size_t operator()(const type_or_decl_base *artifact) const
Function-call Operator to hash the string representation of an ABI artifact.
size_t operator()(const type_or_decl_base_sptr &artifact) const
Function-call Operator to hash the string representation of an ABI artifact.
A predicate for deep equality of instances of type_base*.
A predicate for deep equality of instances of shared_ptr<type_base>
Hash functor for instances of typedef_decl.
Hash functor for instances of union_decl type.
A comparison functor for pointers to var_decl.
bool operator()(const var_decl *l, const var_decl *r) const
Return true if the two instances of var_decl are equal.