23#include <unordered_map>
96using std::unordered_map;
113 size_t operator()(
const type_base_sptr& l)
const;
120typedef unordered_set<type_base_sptr,
131 vector<type_base_sptr>& result);
151 std::unique_ptr<priv> priv_;
157 typedef std::unordered_map<string, std::vector<type_base_sptr> >
170 const type_base_sptr&
173 const type_base_sptr&
176 const type_base_sptr&
219 intern(
const string&)
const;
233#ifdef WITH_DEBUG_SELF_COMPARISON
235 set_self_comparison_debug_input(
const corpus_sptr&
corpus);
238 get_self_comparison_debug_inputs(corpus_sptr& first_corpus,
239 corpus_sptr& second_corpus);
242 self_comparison_debug_is_on(
bool);
245 self_comparison_debug_is_on()
const;
248#ifdef WITH_DEBUG_TYPE_CANONICALIZATION
250 debug_type_canonicalization_is_on(
bool flag);
253 debug_type_canonicalization_is_on()
const;
256 debug_die_canonicalization_is_on(
bool flag);
259 debug_die_canonicalization_is_on()
const;
266#ifdef WITH_DEBUG_SELF_COMPARISON
267 const unordered_map<string, uintptr_t>&
268 get_type_id_canonical_type_map()
const;
270 unordered_map<string, uintptr_t>&
271 get_type_id_canonical_type_map();
273 const unordered_map<uintptr_t, string>&
274 get_pointer_type_id_map()
const;
276 unordered_map<uintptr_t, string>&
277 get_pointer_type_id_map();
280 get_type_id_from_pointer(uintptr_t ptr)
const;
283 get_type_id_from_type(
const type_base *ptr)
const;
286 get_canonical_type_from_type_id(
const char*)
const;
322 : value_(v), loc_manager_(m), is_artificial_(
false)
330 get_location_manager()
const
331 {
return loc_manager_;}
349 {
return is_artificial_;}
365 {is_artificial_ = f;}
372 loc_manager_(l.loc_manager_),
373 is_artificial_(l.is_artificial_)
383 loc_manager_ = l.loc_manager_;
384 is_artificial_ = l.is_artificial_;
390 : value_(), loc_manager_(), is_artificial_()
402 operator bool()
const
412 {
return value_ == other.value_;}
422 {
return value_ < other.value_;}
436 expand(std::string& path,
unsigned& line,
unsigned& column)
const;
451 std::unique_ptr<priv> priv_;
464 unsigned& line,
unsigned& column)
const;
503 return repr1 == repr2;
539 std::hash<string> do_hash;
540 return do_hash(repr);
576typedef unordered_map<interned_string, type_base_wptr, hash_interned_string>
604 std::unique_ptr<priv> priv_;
687 const vector<type_base_wptr>&
697 std::unique_ptr<priv> priv_;
770 const std::string& path,
771 char address_size = 0);
820 const vector<function_type_sptr>&
857 lookup_function_type_in_translation_unit(
const function_type& t,
864 friend type_base_sptr
883 {
return lhs->get_absolute_path() < rhs->get_absolute_path();}
933typedef std::unordered_map<string, elf_symbol_sptr>
938typedef shared_ptr<string_elf_symbol_sptr_map_type>
946typedef std::unordered_map<string, elf_symbols>
989 PROTECTED_VISIBILITY,
999 std::unique_ptr<priv> priv_;
1018 elf_symbol(
const elf_symbol&);
1021 operator=(
const elf_symbol& s);
1026 create(
const environment& e,
1171 get_alias_with_default_symbol_version()
const;
1175 bool include_symbol_itself =
true)
const;
1226compute_aliases_for_elf_symbol(
const elf_symbol& symbol,
1228 vector<elf_symbol_sptr>& alias_set);
1234 std::unique_ptr<priv> priv_;
1246 operator const string&()
const;
1252 str(
const string& s);
1317 get_access_specifier()
const
1325 get_is_static()
const
1326 {
return is_static_;}
1329 set_is_static(
bool s)
1339 return (access_ == o.access_
1340 && is_static_ == o.is_static_);
1352 {
return !operator==(o);}
1419 ABSTRACT_TYPE_OR_DECL,
1420 ABSTRACT_DECL_BASE = 1,
1421 ABSTRACT_SCOPE_DECL = 1 << 1,
1422 GLOBAL_SCOPE_DECL = 1 << 2,
1423 NAMESPACE_DECL = 1 << 3,
1425 FUNCTION_DECL = 1 << 5,
1426 FUNCTION_PARAMETER_DECL = 1 << 6,
1427 METHOD_DECL = 1 << 7,
1428 TEMPLATE_DECL = 1 << 8,
1429 ABSTRACT_TYPE_BASE = 1 << 9,
1430 ABSTRACT_SCOPE_TYPE_DECL = 1 << 10,
1431 BASIC_TYPE = 1 << 11,
1432 SUBRANGE_TYPE = 1 << 12,
1433 QUALIFIED_TYPE = 1 << 13,
1434 POINTER_TYPE = 1 << 14,
1435 REFERENCE_TYPE = 1 << 15,
1436 POINTER_TO_MEMBER_TYPE = 1 << 16,
1437 ARRAY_TYPE = 1 << 17,
1438 ENUM_TYPE = 1 << 18,
1439 TYPEDEF_TYPE = 1 << 19,
1440 CLASS_TYPE = 1 << 20,
1441 UNION_TYPE = 1 << 21,
1442 FUNCTION_TYPE = 1 << 22,
1443 METHOD_TYPE = 1 << 23,
1472 set_hash_value(
hash_t)
const;
1478 mutable std::unique_ptr<priv> priv_;
1523 bool qualified_name =
true)
const = 0;
1553 template<
typename T>
1629 VISIBILITY_PROTECTED,
1655 const string& mangled_name =
"",
1688 bool qualified_name =
true)
const;
1692 bool internal =
false)
const;
1754 const decl_base_sptr
1760 const decl_base_sptr
1789 friend decl_base_sptr
1795 friend 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&);
1855 std::unique_ptr<priv> priv_;
1869 virtual decl_base_sptr
1881 const string& name,
const location& locus,
1933 declarations::iterator before);
1958 friend decl_base_sptr
1961 friend decl_base_sptr
1963 scope_decl::declarations::iterator before,
1993 {
return translation_unit_;}
2021 static type_base_sptr
2022 get_canonical_type_for(type_base_sptr);
2037 friend type_base_sptr
canonicalize(type_base_sptr,
bool,
bool);
2098 operator()(
const type_base_sptr l,
const type_base_sptr r)
const
2103 if (l.get() == r.get())
2129 size_t size_in_bits,
2130 size_t alignment_in_bits,
2132 const string& mangled_name =
"",
2158 bool internal =
false)
const;
2165 bool qualified_name =
true)
const;
2190 size_t size_in_bits,
size_t alignment_in_bits,
2215 bool qualified_name =
true)
const;
2238 std::unique_ptr<priv> priv_;
2244 string build_name(
bool,
bool internal =
false)
const;
2258 CV_VOLATILE = 1 << 1,
2259 CV_RESTRICT = 1 << 2
2298 bool internal =
false)
const;
2310operator==(
const qualified_type_def_sptr&,
const qualified_type_def_sptr&);
2313operator!=(
const qualified_type_def_sptr&,
const qualified_type_def_sptr&);
2339 bool qualified =
true,
bool internal =
false);
2341qualified_type_def_sptr
2352 std::unique_ptr<priv> priv_;
2365 pointer_type_def(
const type_base_sptr& pointed_to_type,
size_t size_in_bits,
2366 size_t alignment_in_bits,
const location& locus);
2369 size_t alignment_in_bits,
const location& locus);
2386 const type_base_sptr
2418 std::unique_ptr<priv> priv_;
2432 bool lvalue,
size_t size_in_bits,
2433 size_t alignment_in_bits,
const location& locus);
2436 size_t alignment_in_bits,
const location& locus);
2454 get_pointed_to_type()
const;
2461 bool internal =
false)
const;
2468 bool qualified_name =
true)
const;
2487 std::unique_ptr<priv> priv_;
2498 const type_base_sptr& member_type,
2499 const type_base_sptr& containing_type,
2500 size_t size_in_bits,
2501 size_t alignment_in_bits,
2510 const type_base_sptr&
2513 const type_base_sptr&
2527 bool internal =
false)
const;
2550 std::unique_ptr<priv> priv_;
2576 std::unique_ptr<priv> priv_;
2593 UNSIGNED_SIGNEDNESS,
2625 const type_base_sptr& underlying_type,
2701 bool qualified_name =
true)
const;
2708 const std::vector<subrange_sptr>& subs,
2712 const std::vector<subrange_sptr>& subs,
2729 bool internal =
false)
const;
2734 const type_base_sptr
2744 get_dimension_count()
const;
2751 bool qualified_name =
true)
const;
2754 get_subrange_representation()
const;
2762 const std::vector<subrange_sptr>&
2787 std::unique_ptr<priv> priv_;
2819 type_base_sptr underlying_type,
2821 const string& mangled_name =
"",
2849 bool qualified_name =
true)
const;
2883 std::unique_ptr<priv> priv_;
2891 enumerator(
const string& name, int64_t value);
2937 std::unique_ptr<priv> priv_;
2948 const type_base_sptr underlying_type,
2950 const string& mangled_name =
"",
2956 const string& mangled_name =
"",
2976 bool qualified_name =
true)
const;
2986 bool internal =
false)
const;
3006 std::unique_ptr<priv> priv_;
3013 size_t offset_in_bits,
3020 get_is_laid_out()
const;
3023 set_is_laid_out(
bool f);
3026 get_offset_in_bits()
const;
3029 set_offset_in_bits(
size_t o);
3070 std::unique_ptr<priv> priv_;
3084 type_base_sptr type,
3086 const string& mangled_name,
3093 const type_base_sptr
3125 bool qualified_name =
true)
const;
3194 bool declared_inline,
3196 const string& mangled_name,
3201 type_base_sptr fn_type,
3202 bool declared_inline,
3204 const string& mangled_name =
"",
3206 binding bind = BINDING_GLOBAL);
3210 bool qualified_name =
true)
const;
3215 const std::vector<parameter_sptr >&
3224 parameters::const_iterator
3233 const type_base_sptr
3252 get_binding()
const;
3317 return l_repr < r_repr;
3337 std::unique_ptr<priv> priv_;
3345 bool variadic_marker =
false);
3351 bool variadic_marker,
3352 bool is_artificial);
3357 bool variadic_marker =
false,
3358 bool is_artificial =
false);
3362 bool variadic_marker =
false);
3366 const type_base_sptr
3382 set_index(
unsigned i);
3385 get_variadic_marker()
const;
3398 bool internal =
false)
const;
3402 bool qualified_name =
true)
const;
3435 std::unique_ptr<priv> priv_;
3444 size_t size_in_bits,
3445 size_t alignment_in_bits);
3448 size_t size_in_bits,
3449 size_t alignment_in_bits);
3452 size_t size_in_bits,
3453 size_t alignment_in_bits);
3479 parameters::const_iterator
3482 parameters::const_iterator
3493 bool qualified_name =
true)
const;
3508 std::unique_ptr<priv> priv_;
3518 class_or_union_sptr class_type,
3519 const std::vector<function_decl::parameter_sptr>& parms,
3521 size_t size_in_bits,
3522 size_t alignment_in_bits);
3525 type_base_sptr class_type,
3526 const std::vector<function_decl::parameter_sptr>& parms,
3528 size_t size_in_bits,
3529 size_t alignment_in_bits);
3533 size_t size_in_bits,
3534 size_t alignment_in_bits);
3537 size_t size_in_bits,
3538 size_t alignment_in_bits);
3559 bool qualified_name =
true)
const;
3569 std::unique_ptr<priv> priv_;
3583 const std::list<template_parameter_sptr>&
3601 std::unique_ptr<priv> priv_;
3621 get_enclosing_template_decl()
const;
3630 std::unique_ptr<priv> priv_;
3664 std::unique_ptr<priv> priv_;
3676 type_base_sptr type,
3684 const type_base_sptr
3697 std::unique_ptr<priv> priv_;
3732 std::unique_ptr<priv> priv_;
3739 type_base_sptr composed_type);
3741 const type_base_sptr
3754 std::unique_ptr<priv> priv_;
3783 shared_ptr<function_decl>
3799 std::unique_ptr<priv> priv_;
3825 shared_ptr<class_decl>
3852 : access_(a), is_static_(is_static)
3872 {
return is_static_;}
3896 bool declared_inline,
const location& locus,
3897 const string& mangled_name =
"",
3899 binding bind = BINDING_GLOBAL);
3903 bool declared_inline,
3905 const string& mangled_name =
"",
3907 binding bind = BINDING_GLOBAL);
3909 method_decl(
const string& name, type_base_sptr type,
3910 bool declared_inline,
const location& locus,
3911 const string& mangled_name =
"",
3913 binding bind = BINDING_GLOBAL);
3925 {function_decl::set_type(fn_type);}
3970operator==(
const method_decl_sptr& l,
const method_decl_sptr& r);
3973operator!=(
const method_decl_sptr& l,
const method_decl_sptr& r);
3988 virtual decl_base_sptr
4015 size_t size_in_bits,
size_t align_in_bits,
4021 size_t size_in_bits,
size_t align_in_bits,
4025 bool is_declaration_only =
true);
4053 bool is_laid_out,
bool is_static,
4054 size_t offset_in_bits);
4077 bool is_static,
bool is_ctor,
4078 bool is_dtor,
bool is_const);
4084 size_t vtable_offset,
4085 bool is_static,
bool is_ctor,
4086 bool is_dtor,
bool is_const);
4109 const member_function_templates&
4115 const member_class_templates&
4135 friend method_decl_sptr
4139 friend method_decl_sptr
4141 const method_decl_sptr& m);
4161 const method_decl_sptr& f);
4168operator==(
const class_or_union_sptr& l,
const class_or_union_sptr& r);
4171operator!=(
const class_or_union_sptr& l,
const class_or_union_sptr& r);
4182 insert_member_decl(decl_base_sptr member);
4217 size_t size_in_bits,
size_t align_in_bits,
4224 size_t size_in_bits,
size_t align_in_bits,
4231 size_t size_in_bits,
size_t align_in_bits,
4235 size_t size_in_bits,
size_t align_in_bits,
4240 bool is_declaration_only =
true);
4247 bool qualified_name =
true)
const;
4323 const method_decl_sptr& f);
4364 std::unique_ptr<priv> priv_;
4375 long offset_in_bits = -1,
bool is_virtual =
false);
4378 long offset_in_bits = -1,
bool is_virtual =
false);
4429 size_t size_in_bits,
const location& locus,
4434 size_t size_in_bits,
const location& locus,
4440 size_t size_in_bits,
const location& locus,
4444 size_t size_in_bits,
const location& locus,
4448 bool is_declaration_only =
true);
4455 bool qualified_name =
true)
const;
4480 const method_decl_sptr& f);
4487operator==(
const union_decl_sptr& l,
const union_decl_sptr& r);
4490operator!=(
const union_decl_sptr& l,
const union_decl_sptr& r);
4498 ssize_t vtable_offset_in_bits_;
4499 bool is_constructor_;
4500 bool is_destructor_;
4507 vtable_offset_in_bits_(-1),
4508 is_constructor_(
false),
4509 is_destructor_(
false),
4516 vtable_offset_in_bits_(-1),
4517 is_constructor_(
false),
4518 is_destructor_(
false),
4527 size_t vtable_offset_in_bits,
4531 is_virtual_(is_virtual),
4532 vtable_offset_in_bits_(vtable_offset_in_bits),
4540 {
return is_virtual_;}
4543 is_virtual(
bool is_virtual)
4544 {is_virtual_ = is_virtual;}
4554 {
return vtable_offset_in_bits_;}
4564 {vtable_offset_in_bits_ = s;}
4574 {
return is_constructor_;}
4582 {is_constructor_ = f;}
4591 {
return is_destructor_;}
4599 {is_destructor_ = f;}
4633 const char* dm_name);
4646 bool is_constructor_;
4648 shared_ptr<function_tdecl> fn_tmpl_;
4659 bool is_constructor,
bool is_const)
4662 member_base(access, is_static), is_constructor_(is_constructor),
4663 is_const_(is_const), fn_tmpl_(f)
4667 is_constructor()
const
4668 {
return is_constructor_;}
4678 as_function_tdecl()
const
4689operator==(
const member_function_template_sptr& l,
4690 const member_function_template_sptr& r);
4693operator!=(
const member_function_template_sptr& l,
4694 const member_function_template_sptr& r);
4701 shared_ptr<class_tdecl> class_tmpl_;
4720 {
return *class_tmpl_; }
4723 as_class_tdecl()
const
4724 {
return class_tmpl_;}
4740operator==(
const member_class_template_sptr& l,
4741 const member_class_template_sptr& r);
4744operator!=(
const member_class_template_sptr& l,
4745 const member_class_template_sptr& r);
4811 std::unique_ptr<priv> priv_;
4870 virtual bool visit_begin(
var_decl*);
4906fns_to_str(vector<function_decl*>::const_iterator a_begin,
4907 vector<function_decl*>::const_iterator a_end,
4908 vector<function_decl*>::const_iterator b_begin,
4909 vector<function_decl*>::const_iterator b_end,
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.
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.
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.
void add_member_function(method_decl_sptr f, access_specifier a, bool is_static, bool is_ctor, bool is_dtor, bool is_const)
Add a member function.
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.
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(),...
virtual void remove_member_decl(decl_base_sptr)
Remove a given decl from the current class_or_union scope.
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.
void add_member_function_template(member_function_template_sptr)
Append a member function template to the class_or_union.
unordered_map< ssize_t, member_functions > virtual_mem_fn_map_type
Convenience typedef.
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.
void add_data_member(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.
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.
decl_base_sptr insert_member_decl(decl_base_sptr member)
Insert a data member to this class_or_union type.
virtual decl_base_sptr add_member_decl(const decl_base_sptr &)
Add a member declaration to the current instance of class_or_union. The member declaration can be eit...
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
void add_member_class_template(member_class_template_sptr m)
Append a member class template to the class_or_union.
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.
void maybe_fixup_members_of_anon_data_member(var_decl_sptr &anon_dm)
Fixup the members of the type of an anonymous data member.
vector< var_decl_sptr > data_members
Convenience typedef.
virtual ~class_or_union()
Destrcutor of the class_or_union type.
bool has_no_member() const
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.
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.
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.
Abstract a class template.
shared_ptr< class_decl > get_pattern() const
Getter of the pattern of the template.
void set_pattern(class_decl_sptr p)
Setter 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
Return true iff both scopes have the same names and have the same member decls.
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.
const interned_string & get_cached_pretty_representation(bool internal=false) const
Get the pretty representation of the current decl.
scope_decl * get_scope() const
Return the type containing the current decl, if any.
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.
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.
typedef_decl_sptr get_naming_typedef() const
Getter for the naming typedef of the current decl.
virtual const interned_string & get_name() const
Getter for the name of the current decl.
virtual void set_scope(scope_decl *)
Setter of the scope 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.
bool get_is_anonymous() const
Test if the current declaration is anonymous.
friend decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl *scpe)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
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.
void set_naming_typedef(const typedef_decl_sptr &)
Set the naming typedef of the current instance of decl_base.
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.
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.
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.
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 &, const decl_base &, change_kind *)
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 * 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 *)
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.
friend bool enum_has_non_name_change(const enum_type_decl &l, const enum_type_decl &r, change_kind *k)
Test if two enums differ, but not by a name change.
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....
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.
bool canonicalization_is_done() const
Test if the canonicalization of types created out of the current environment is done.
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.
bool canonicalization_started() const
Getter of a flag saying if the canonicalization process has started or not.
interned_string intern(const string &) const
Do intern a string.
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...
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.
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.
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 function_type_sptr get_type() const
Return the type of the current instance of function_decl.
function_decl(const string &name, function_type_sptr function_type, bool declared_inline, const location &locus, const string &mangled_name, visibility vis, binding bind)
Constructor of the 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.
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 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.
binding get_binding() const
Get the binding of the function template.
void set_pattern(shared_ptr< function_decl > p)
Set a new pattern to 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.
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.
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.
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.
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.
location(const location &l)
Copy constructor of the location.
unsigned get_value() const
Get the value of the location.
void set_is_artificial(bool f)
Set the artificial-ness 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.
void vtable_offset(size_t s)
Setter for the vtable offset property.
bool is_const() const
Getter for the 'is-const' property.
void is_destructor(bool f)
Setter for the 'is-destructor' property.
void is_const(bool f)
Setter for the 'is-const' property.
size_t vtable_offset() const
Getter for the vtable offset property.
void is_constructor(bool f)
Setter for the 'is-constructor' 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.
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.
bool get_is_for_static_method() const
Test if the current method type is for a static method or not.
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.
namespace_decl(const environment &env, const string &name, const location &locus, visibility vis=VISIBILITY_DEFAULT)
Constructor.
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.
virtual size_t get_num_anonymous_member_classes() const
Getter for the number of anonymous classes contained in this scope.
void remove_member_type(type_base_sptr t)
Remove a member type from the current class_or_union scope.
void insert_member_type(type_base_sptr t, declarations::iterator before)
Insert a member type.
void add_member_type(type_base_sptr t)
Add a member type to the current instance of class_or_union.
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.
scopes & get_member_scopes()
Getter for the scopes carried by the current scope.
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.
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.
std::vector< function_type_sptr > function_types
Convenience typedef for a vector of function_type_sptr.
decl_base_sptr insert_member_decl(decl_base_sptr member, declarations::iterator before)
Insert a member decl to this scope, right before an element pointed to by a given iterator....
std::vector< decl_base_sptr > declarations
Convenience typedef for a vector of decl_base_sptr.
friend decl_base_sptr insert_decl_into_scope(decl_base_sptr decl, scope_decl::declarations::iterator before, scope_decl *scope)
Inserts a declaration into a given scope, before a given IR child node of the scope.
const 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.
virtual void remove_member_decl(decl_base_sptr member)
Remove a declaration from the current scope.
virtual decl_base_sptr add_member_decl(const 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_...
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.
friend decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl *scope)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
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,...
void set_address_size(char)
Setter of the address size in this 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...
const scope_decl_sptr & get_global_scope() const
Getter of the the global scope of the translation unit.
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 vector< function_type_sptr > & get_live_fn_types() const
Get the vector of function types that are used in the current translation unit.
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.
const interned_string & get_cached_pretty_representation(bool internal=false) const
Get the pretty representation of the current type.
type_base * get_naked_canonical_type() const
Getter of the canonical type pointer.
friend type_base_sptr canonicalize(type_base_sptr, bool, bool)
Compute the canonical type of a given type.
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...
const vector< type_base_wptr > & get_types_sorted_by_name() const
Getter of all types types sorted by their pretty representation.
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 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.
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.
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.
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.
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.
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 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 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.
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(...
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.
string get_pretty_representation(diff *d)
Get a copy of the pretty representation of a diff node.
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.
bool enum_has_non_name_change(const enum_type_decl &l, const enum_type_decl &r, change_kind *k)
Test if two enums differ, but not by a name change.
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.
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 ...
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.
void sort_types(const canonical_type_sptr_set_type &types, vector< type_base_sptr > &result)
Sort types in a hopefully stable manner.
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...
decl_base_sptr insert_decl_into_scope(decl_base_sptr decl, scope_decl::declarations::iterator before, scope_decl *scope)
Inserts a declaration into a given scope, before a given IR child node of the scope.
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.
corpus::origin operator&(corpus::origin l, corpus::origin r)
Bitwise & operator for the corpus::origin type.
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 equals(const decl_base &l, const decl_base &r, change_kind *k)
Compares two instances of decl_base.
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.
location get_location(const type_base_sptr &type)
Get the location of the declaration of a given type.
translation_unit * get_translation_unit(const type_or_decl_base &t)
Return the translation unit a declaration belongs to.
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.
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.
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_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.
method_decl_sptr copy_member_function(const class_or_union_sptr &t, const method_decl_sptr &method)
Copy a method of a class_or_union into a new class_or_union.
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.
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.
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.
The private data of type_or_decl_base.
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.