libabigail
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
class_or_union Class Reference

The base type of class_decl and union_decl. More...

#include <abg-ir.h>

Inheritance diagram for class_or_union:
[legend]

Classes

struct  hash
 Hasher for the class_or_union type. More...
 
struct  priv
 

Public Types

typedef vector< type_base_sptr > member_types
 Convenience typedef. More...
 
typedef vector< var_decl_sptrdata_members
 Convenience typedef. More...
 
typedef vector< method_decl_sptr > member_functions
 Convenience typedef. More...
 
typedef unordered_map< ssize_t, member_functionsvirtual_mem_fn_map_type
 Convenience typedef. More...
 
typedef unordered_map< string, method_decl * > string_mem_fn_ptr_map_type
 Convenience typedef. More...
 
typedef unordered_map< string, method_decl_sptr > string_mem_fn_sptr_map_type
 Convenience typedef. More...
 
- Public Types inherited from scope_decl
typedef std::vector< decl_base_sptr > declarations
 Convenience typedef for a vector of decl_base_sptr. More...
 
typedef std::vector< function_type_sptrfunction_types
 Convenience typedef for a vector of function_type_sptr. More...
 
typedef std::vector< scope_decl_sptrscopes
 Convenience typedef for a vector of scope_decl_sptr. More...
 
- Public Types inherited from decl_base
enum  binding { BINDING_NONE , BINDING_LOCAL , BINDING_GLOBAL , BINDING_WEAK }
 ELF binding. More...
 
enum  visibility {
  VISIBILITY_NONE , VISIBILITY_DEFAULT , VISIBILITY_PROTECTED , VISIBILITY_HIDDEN ,
  VISIBILITY_INTERNAL
}
 ELF visibility. More...
 

Public Member Functions

 class_or_union (const environment &env, const string &name, bool is_declaration_only=true)
 Constructor of the class_or_union type. More...
 
 class_or_union (const environment &env, const string &name, size_t size_in_bits, size_t align_in_bits, const location &locus, visibility vis)
 A constructor for instances of class_or_union. More...
 
 class_or_union (const environment &env, const string &name, size_t size_in_bits, size_t align_in_bits, const location &locus, visibility vis, member_types &mbrs, data_members &data_mbrs, member_functions &member_fns)
 A Constructor for instances of class_or_union. More...
 
virtual ~class_or_union ()
 Destrcutor of the class_or_union type. More...
 
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. More...
 
void add_member_class_template (member_class_template_sptr m)
 Append a member class template to the class_or_union. More...
 
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. More...
 
void add_member_function (method_decl_sptr f, access_specifier a, bool is_virtual, size_t vtable_offset, bool is_static, bool is_ctor, bool is_dtor, bool is_const)
 Add a member function to the current instance of class_or_union. More...
 
void add_member_function_template (member_function_template_sptr)
 Append a member function template to the class_or_union. More...
 
const var_decl_sptr find_anonymous_data_member (const var_decl_sptr &) const
 Find an anonymous data member in the class. More...
 
const var_decl_sptr find_data_member (const string &) const
 Find a data member of a given name in the current class_or_union. More...
 
const var_decl_sptr find_data_member (const var_decl_sptr &) const
 Find a given data member. More...
 
method_declfind_member_function (const string &mangled_name)
 Find a method, using its linkage name as a key. More...
 
const method_declfind_member_function (const string &mangled_name) const
 Find a method, using its linkage name as a key. More...
 
method_declfind_member_function_from_signature (const string &s)
 Find a method (member function) using its signature (pretty representation) as a key. More...
 
const method_declfind_member_function_from_signature (const string &s) const
 Find a method (member function) using its signature (pretty representation) as a key. More...
 
method_decl_sptr find_member_function_sptr (const string &mangled_name)
 Find a method, using its linkage name as a key. More...
 
virtual size_t get_alignment_in_bits () const
 Getter of the alignment of the class_or_union type. More...
 
const data_membersget_data_members () const
 Get the data members of this class_or_union. More...
 
const member_class_templates & get_member_class_templates () const
 Get the member class templates of this class. More...
 
const member_function_templates & get_member_function_templates () const
 Get the member function templates of this class. More...
 
const member_functionsget_member_functions () const
 Get the member functions of this class_or_union. More...
 
const data_membersget_non_static_data_members () const
 Get the non-static data memebers of this class_or_union. More...
 
virtual size_t get_num_anonymous_member_classes () const
 Get the number of anonymous member classes contained in this class. More...
 
virtual size_t get_num_anonymous_member_enums () const
 Get the number of anonymous member enums contained in this class. More...
 
virtual size_t get_num_anonymous_member_unions () const
 Get the number of anonymous member unions contained in this class. More...
 
virtual size_t get_size_in_bits () const
 Getter of the size of the class_or_union type. More...
 
bool has_no_member () const
 
virtual bool operator== (const class_or_union &) const
 Equality operator. More...
 
virtual bool operator== (const decl_base &) const
 Equality operator. More...
 
virtual bool operator== (const type_base &) const
 Equality operator. More...
 
virtual void set_alignment_in_bits (size_t)
 Setter of the alignment of the class type. More...
 
virtual void set_size_in_bits (size_t)
 Setter of the size of the class_or_union type. More...
 
virtual bool traverse (ir_node_visitor &v)
 This implements the ir_traversable_base::traverse pure virtual function. More...
 
- Public Member Functions inherited from scope_type_decl
 scope_type_decl (const environment &env, const string &name, size_t size_in_bits, size_t alignment_in_bits, const location &locus, visibility vis=VISIBILITY_DEFAULT)
 Constructor. More...
 
- Public Member Functions inherited from scope_decl
 scope_decl (const environment &env, const string &name, const location &locus, visibility vis=VISIBILITY_DEFAULT)
 Constructor of the scope_decl type. More...
 
 scope_decl (const environment &env, location &l)
 Constructor of the scope_decl type. More...
 
void add_member_type (type_base_sptr t)
 Add a member type to the current instance of class_or_union. More...
 
type_base_sptr add_member_type (type_base_sptr t, access_specifier a)
 Add a member type to the current instance of class_or_union. More...
 
bool find_iterator_for_member (const decl_base *, declarations::iterator &)
 Find a member of the current scope and return an iterator on it. More...
 
bool find_iterator_for_member (const decl_base_sptr, declarations::iterator &)
 Find a member of the current scope and return an iterator on it. More...
 
type_base_sptr find_member_type (const string &name) const
 Find a member type of a given name, inside the current scope_decl. More...
 
canonical_type_sptr_set_typeget_canonical_types ()
 @eturn the set of canonical types of the the current scope. More...
 
const canonical_type_sptr_set_typeget_canonical_types () const
 @eturn the set of canonical types of the the current scope. More...
 
virtual size_t get_hash () const
 Return the hash value for the current instance of scope_decl. More...
 
declarationsget_member_decls ()
 Getter for the member declarations carried by the current scope_decl. More...
 
const declarationsget_member_decls () const
 Getter for the member declarations carried by the current scope_decl. More...
 
scopesget_member_scopes ()
 Getter for the scopes carried by the current scope. More...
 
const scopesget_member_scopes () const
 Getter for the scopes carried by the current scope. More...
 
const type_base_sptrs_typeget_member_types () const
 Get the member types of this scope_decl. More...
 
const type_base_sptrs_typeget_sorted_canonical_types () const
 Return a vector of sorted canonical types of the current scope. More...
 
const declarationsget_sorted_member_decls () const
 Getter for the sorted member declarations carried by the current scope_decl. More...
 
const type_base_sptrs_typeget_sorted_member_types () const
 Get the sorted member types of this scope_decl. More...
 
void insert_member_type (type_base_sptr t, declarations::iterator before)
 Insert a member type. More...
 
bool is_empty () const
 Test if the current scope is empty. More...
 
void remove_member_type (type_base_sptr t)
 Remove a member type from the current class_or_union scope. More...
 
- Public Member Functions inherited from decl_base
 decl_base (const environment &, const location &)
 Constructor for the decl_base type. More...
 
 decl_base (const environment &e, const interned_string &name, const location &locus, const interned_string &mangled_name=interned_string(), visibility vis=VISIBILITY_DEFAULT)
 Constructor. More...
 
 decl_base (const environment &e, const string &name, const location &locus, const string &mangled_name="", visibility vis=VISIBILITY_DEFAULT)
 Constructor for the decl_base type. More...
 
virtual ~decl_base ()
 Destructor of the decl_base type. More...
 
const decl_base_sptr get_definition_of_declaration () const
 If this decl_base is declaration-only, get its definition, if any. More...
 
const decl_base_sptr get_earlier_declaration () const
 If this decl_base is a definition, get its earlier declaration. More...
 
bool get_has_anonymous_parent () const
 Get the "has_anonymous_parent" flag of the current declaration. More...
 
bool get_is_anonymous () const
 Test if the current declaration is anonymous. More...
 
bool get_is_anonymous_or_has_anonymous_parent () const
 
bool get_is_declaration_only () const
 Test if a decl_base is a declaration-only decl. More...
 
bool get_is_in_public_symbol_table () const
 Test if the decl is defined in a ELF symbol table as a public symbol. More...
 
const interned_stringget_linkage_name () const
 Getter for the mangled name. More...
 
const locationget_location () const
 Get the location of a given declaration. More...
 
const decl_baseget_naked_definition_of_declaration () const
 If this decl_base is declaration-only, get its definition, if any. More...
 
const interned_stringget_name () const
 Getter for the name of the current decl. More...
 
typedef_decl_sptr get_naming_typedef () const
 Getter for the naming typedef of the current decl. More...
 
virtual string get_pretty_representation (bool internal=false, bool qualified_name=true) const
 Get the pretty representatin of the current declaration. More...
 
virtual const interned_stringget_qualified_name (bool internal=false) const
 Return the qualified name of the decl. More...
 
virtual void get_qualified_name (interned_string &qualified_name, bool internal=false) const
 Compute the qualified name of the decl. More...
 
const interned_stringget_qualified_parent_name () const
 Return a copy of the qualified name of the parent of the current decl. More...
 
scope_declget_scope () const
 Return the type containing the current decl, if any. More...
 
virtual const interned_stringget_scoped_name () const
 Return the scoped name of the decl. More...
 
visibility get_visibility () const
 Getter for the visibility of the decl. More...
 
virtual bool operator!= (const decl_base &) const
 Inequality operator. More...
 
void set_definition_of_declaration (const decl_base_sptr &)
 Set the definition of this declaration-only decl_base. More...
 
void set_earlier_declaration (const decl_base_sptr &)
 set the earlier declaration of this decl_base definition. More...
 
void set_is_anonymous (bool)
 Set the "is_anonymous" flag of the current declaration. More...
 
void set_is_declaration_only (bool f)
 Set a flag saying if the enum_type_decl is a declaration-only enum_type_decl. More...
 
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, defined as public (global or weak). More...
 
virtual void set_linkage_name (const string &m)
 Setter for the linkage name. More...
 
void set_location (const location &l)
 Set the location for a given declaration. More...
 
void set_name (const string &n)
 Setter for the name of the decl. More...
 
void set_naming_typedef (const typedef_decl_sptr &)
 Set the naming typedef of the current instance of decl_base. More...
 
virtual void set_scope (scope_decl *)
 Setter of the scope of the current decl. More...
 
void set_visibility (visibility v)
 Setter for the visibility of the decl. More...
 
- Public Member Functions inherited from type_or_decl_base
 type_or_decl_base (const environment &, enum type_or_decl_kind k=ABSTRACT_TYPE_OR_DECL)
 Constructor of type_or_decl_base. More...
 
virtual ~type_or_decl_base ()
 The destructor of the type_or_decl_base type. More...
 
locationget_artificial_location () const
 Getter of the artificial location of the artifact. More...
 
corpusget_corpus ()
 Get the corpus this ABI artifact belongs to. More...
 
const corpusget_corpus () const
 Get the corpus this ABI artifact belongs to. More...
 
const environmentget_environment () const
 Getter of the environment of the current ABI artifact. More...
 
bool get_is_artificial () const
 Getter of the flag that says if the artefact is artificial. More...
 
translation_unitget_translation_unit ()
 Get the translation_unit this ABI artifact belongs to. More...
 
const translation_unitget_translation_unit () const
 Get the translation_unit this ABI artifact belongs to. More...
 
bool has_artificial_location () const
 Test if the current ABI artifact carries an artificial location. More...
 
void set_artificial_location (const location &)
 Setter of the artificial location of the artificat. More...
 
void set_is_artificial (bool)
 Setter of the flag that says if the artefact is artificial. More...
 
void set_translation_unit (translation_unit *)
 Set the translation_unit this ABI artifact belongs to. More...
 
- Public Member Functions inherited from traversable_base
virtual ~traversable_base ()
 Destructor of the traversable_base type. More...
 
- Public Member Functions inherited from type_base
 type_base (const environment &e, size_t s, size_t a)
 The constructor of type_base. More...
 
const interned_stringget_cached_pretty_representation (bool internal=false) const
 Get the pretty representation of the current type. More...
 
type_base_sptr get_canonical_type () const
 Getter of the canonical type of the current instance of type_base. More...
 
type_baseget_naked_canonical_type () const
 Getter of the canonical type pointer. More...
 
virtual bool operator!= (const type_base &) const
 Inequality operator. More...
 

Public Attributes

privpriv_
 
- Public Attributes inherited from decl_base
priv * priv_
 
- Public Attributes inherited from type_base
privpriv_
 

Protected Member Functions

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 either a member type, data member, member function, or member template. More...
 
decl_base_sptr insert_member_decl (decl_base_sptr member)
 Insert a data member to this class_or_union type. More...
 
void maybe_fixup_members_of_anon_data_member (var_decl_sptr &anon_dm)
 Fixup the members of the type of an anonymous data member. More...
 
virtual void remove_member_decl (decl_base_sptr)
 Remove a given decl from the current class_or_union scope. More...
 
- Protected Member Functions inherited from scope_decl
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. Note that user code should not use this, but rather use insert_decl_into_scope. More...
 
- Protected Member Functions inherited from decl_base
 decl_base (const decl_base &)
 
void clear_qualified_name ()
 Clear the qualified name of this decl. More...
 
context_relget_context_rel ()
 Getter for the context relationship. More...
 
const context_relget_context_rel () const
 Getter for the context relationship. More...
 
const interned_stringpeek_qualified_name () const
 Getter for the qualified name. More...
 
const interned_stringpeek_temporary_qualified_name () const
 Getter of the temporary qualified name of the current declaration. More...
 
void set_context_rel (context_rel *c)
 
void set_qualified_name (const interned_string &) const
 Setter for the qualified name. More...
 
void set_temporary_qualified_name (const interned_string &) const
 Setter for the temporary qualified name of the current declaration. More...
 
- Protected Member Functions inherited from type_or_decl_base
bool hashing_started () const
 Getter for the 'hashing_started' property. More...
 
void hashing_started (bool) const
 Setter for the 'hashing_started' property. More...
 
enum type_or_decl_kind kind () const
 Getter for the "kind" property of type_or_decl_base type. More...
 
void kind (enum type_or_decl_kind)
 Setter for the "kind" property of type_or_decl_base type. More...
 
type_or_decl_baseoperator= (const type_or_decl_base &)
 
void * runtime_type_instance ()
 Getter of the pointer to the runtime type sub-object of the current instance. More...
 
const void * runtime_type_instance () const
 Getter of the pointer to the runtime type sub-object of the current instance. More...
 
void runtime_type_instance (void *)
 Setter of the pointer to the runtime type sub-object of the current instance. More...
 
void * type_or_decl_base_pointer ()
 Getter of the pointer to either the type_base sub-object of the current instance if it's a type, or to the decl_base sub-object of the current instance if it's a decl. More...
 
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, or to the decl_base sub-object of the current instance if it's a decl. More...
 
- Protected Member Functions inherited from traversable_base
 traversable_base ()
 Default constructor of the traversable_base type. More...
 
bool visiting () const
 This should returns false before and after the node has been visiting. During the visiting of the node (and of its children) this should return true. More...
 
void visiting (bool f)
 The traversing code should be responsible of calling this, not the user code. More...
 
- Protected Member Functions inherited from type_base
virtual void on_canonical_type_set ()
 This method is invoked automatically right after the current instance of class_decl has been canonicalized. More...
 

Friends

class class_decl
 
method_decl_sptr copy_member_function (class_or_union_sptr &t, const method_decl *m)
 
method_decl_sptr copy_member_function (class_or_union_sptr &t, const method_decl_sptr &m)
 
bool equals (const class_decl &, const class_decl &, change_kind *)
 Compares two instances of class_decl. More...
 
bool equals (const class_or_union &, const class_or_union &, change_kind *)
 Compares two instances of class_or_union. More...
 
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(), this function ensures that the member function is added to the specific vectors and maps of virtual member function of its class. More...
 
class method_decl
 
void set_member_is_static (decl_base &d, bool s)
 Sets the static-ness property of a class member. More...
 

Additional Inherited Members

- Protected Types inherited from type_or_decl_base
enum  type_or_decl_kind {
  ABSTRACT_TYPE_OR_DECL , ABSTRACT_DECL_BASE , ABSTRACT_SCOPE_DECL , GLOBAL_SCOPE_DECL ,
  NAMESPACE_DECL , VAR_DECL , FUNCTION_DECL , FUNCTION_PARAMETER_DECL ,
  METHOD_DECL , TEMPLATE_DECL , ABSTRACT_TYPE_BASE , ABSTRACT_SCOPE_TYPE_DECL ,
  BASIC_TYPE , SUBRANGE_TYPE , QUALIFIED_TYPE , POINTER_TYPE ,
  REFERENCE_TYPE , POINTER_TO_MEMBER_TYPE , ARRAY_TYPE , ENUM_TYPE ,
  TYPEDEF_TYPE , CLASS_TYPE , UNION_TYPE , FUNCTION_TYPE ,
  METHOD_TYPE
}
 This is a bitmap type which instance is meant to contain the runtime type of a given ABI artifact. Bits of the identifiers of the type of a given artifact as well as the types it inherits from are to be set to 1. More...
 

Detailed Description

The base type of class_decl and union_decl.

Definition at line 4028 of file abg-ir.h.

Member Typedef Documentation

◆ data_members

typedef vector<var_decl_sptr> data_members

Convenience typedef.

Definition at line 4059 of file abg-ir.h.

◆ member_functions

typedef vector<method_decl_sptr> member_functions

Convenience typedef.

Definition at line 4060 of file abg-ir.h.

◆ member_types

typedef vector<type_base_sptr> member_types

Convenience typedef.

Definition at line 4058 of file abg-ir.h.

◆ string_mem_fn_ptr_map_type

typedef unordered_map<string, method_decl*> string_mem_fn_ptr_map_type

Convenience typedef.

Definition at line 4062 of file abg-ir.h.

◆ string_mem_fn_sptr_map_type

typedef unordered_map<string, method_decl_sptr> string_mem_fn_sptr_map_type

Convenience typedef.

Definition at line 4063 of file abg-ir.h.

◆ virtual_mem_fn_map_type

typedef unordered_map<ssize_t, member_functions> virtual_mem_fn_map_type

Convenience typedef.

Definition at line 4061 of file abg-ir.h.

Constructor & Destructor Documentation

◆ class_or_union() [1/3]

class_or_union ( const environment env,
const string &  name,
size_t  size_in_bits,
size_t  align_in_bits,
const location locus,
visibility  vis,
member_types mem_types,
data_members data_members,
member_functions member_fns 
)

A Constructor for instances of class_or_union.

Parameters
envthe environment we are operating from.
namethe identifier of the class.
size_in_bitsthe size of an instance of class_or_union, expressed in bits
align_in_bitsthe alignment of an instance of class_or_union, expressed in bits.
locusthe source location of declaration point this class.
visthe visibility of instances of class_or_union.
mem_typesthe vector of member types of this instance of class_or_union.
data_membersthe vector of data members of this instance of class_or_union.
member_fnsthe vector of member functions of this instance of class_or_union.

Definition at line 23101 of file abg-ir.cc.

◆ class_or_union() [2/3]

class_or_union ( const environment env,
const string &  name,
size_t  size_in_bits,
size_t  align_in_bits,
const location locus,
visibility  vis 
)

A constructor for instances of class_or_union.

Parameters
envthe environment we are operating from.
namethe name of the class.
size_in_bitsthe size of an instance of class_or_union, expressed in bits
align_in_bitsthe alignment of an instance of class_or_union, expressed in bits.
locusthe source location of declaration point this class.
visthe visibility of instances of class_or_union.

Definition at line 23151 of file abg-ir.cc.

◆ class_or_union() [3/3]

class_or_union ( const environment env,
const string &  name,
bool  is_declaration_only = true 
)

Constructor of the class_or_union type.

Parameters
envthe environment we are operating from.
namethe name of the class_or_union.
is_declaration_onlya boolean saying whether the instance represents a declaration only, or not.

Definition at line 23173 of file abg-ir.cc.

◆ ~class_or_union()

~class_or_union ( )
virtual

Destrcutor of the class_or_union type.

Definition at line 23270 of file abg-ir.cc.

Member Function Documentation

◆ add_data_member()

void add_data_member ( var_decl_sptr  v,
access_specifier  access,
bool  is_laid_out,
bool  is_static,
size_t  offset_in_bits 
)

Add a data member to the current instance of class_or_union.

Parameters
va var_decl to add as a data member. A proper class_or_union::data_member is created from v and added to the class_or_union. This var_decl should not have been already added to a scope.
accessthe access specifier for the data member.
is_laid_outwhether the data member was laid out. That is, if its offset has been computed. In the pattern of a class template for instance, this would be set to false.
is_staticwhether the data memer is static.
offset_in_bitsif is_laid_out is true, this is the offset of the data member, expressed (oh, surprise) in bits.

Definition at line 23472 of file abg-ir.cc.

◆ add_member_class_template()

void add_member_class_template ( member_class_template_sptr  m)

Append a member class template to the class_or_union.

Parameters
mthe member function template to append.

TODO: use our own ABG_ASSERTion facility that adds a meaningful error message or something like a structured error.

Definition at line 23755 of file abg-ir.cc.

◆ add_member_decl()

decl_base_sptr add_member_decl ( const decl_base_sptr &  d)
protectedvirtual

Add a member declaration to the current instance of class_or_union. The member declaration can be either a member type, data member, member function, or member template.

Parameters
dthe member declaration to add.

Reimplemented from scope_decl.

Definition at line 23279 of file abg-ir.cc.

◆ add_member_function() [1/2]

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.

Parameters
fthe new member function to add.
athe access specifier to use for the new member function.
is_staticwhether the new member function is static.
is_ctorwhether the new member function is a constructor.
is_dtorwhether the new member function is a destructor.
is_constwhether the new member function is const.

Definition at line 23623 of file abg-ir.cc.

◆ add_member_function() [2/2]

void add_member_function ( method_decl_sptr  f,
access_specifier  a,
bool  is_virtual,
size_t  vtable_offset,
bool  is_static,
bool  is_ctor,
bool  is_dtor,
bool  is_const 
)

Add a member function to the current instance of class_or_union.

Parameters
fa method_decl to add to the current class. This function should not have been already added to a scope.
accessthe access specifier for the member function to add.
is_virtualif this is true then it means the function f is a virtual function. That also means that the current instance of class_or_union is actually an instance of class_decl.
vtable_offsetthe offset of the member function in the virtual table. This parameter is taken into account only if is_virtual is true.
is_staticwhether the member function is static.
is_ctorwhether the member function is a constructor.
is_dtorwhether the member function is a destructor.
is_constwhether the member function is const.

Definition at line 25261 of file abg-ir.cc.

◆ add_member_function_template()

void add_member_function_template ( member_function_template_sptr  m)

Append a member function template to the class_or_union.

Parameters
mthe member function template to append.

TODO: use our own ABG_ASSERTion facility that adds a meaningful error message or something like a structured error.

Definition at line 23741 of file abg-ir.cc.

◆ find_anonymous_data_member()

const var_decl_sptr find_anonymous_data_member ( const var_decl_sptr v) const

Find an anonymous data member in the class.

Parameters
vthe anonymous data member to find.
Returns
the anonymous data member found, or nil if none was found.

Definition at line 23556 of file abg-ir.cc.

◆ find_data_member() [1/2]

const var_decl_sptr find_data_member ( const string &  name) const

Find a data member of a given name in the current class_or_union.

Parameters
namethe name of the data member to find in the current class_or_union.
Returns
a pointer to the var_decl that represents the data member to find inside the current class_or_union.

Definition at line 23526 of file abg-ir.cc.

◆ find_data_member() [2/2]

const var_decl_sptr find_data_member ( const var_decl_sptr v) const

Find a given data member.

This function takes a var_decl as an argument. If it has a non-empty name, then it tries to find a data member which has the same name as the argument.

If it has an empty name, then the var_decl is considered as an anonymous data member. In that case, this function tries to find an anonymous data member which type equals that of the var_decl argument.

Parameters
vthis carries either the name of the data member we need to look for, or the type of the anonymous data member we are looking for.

Definition at line 23589 of file abg-ir.cc.

◆ find_member_function() [1/2]

method_decl * find_member_function ( const string &  linkage_name)

Find a method, using its linkage name as a key.

Parameters
linkage_namethe linkage name of the method to find.
Returns
the method found, or nil if none was found.

Definition at line 23671 of file abg-ir.cc.

◆ find_member_function() [2/2]

const method_decl * find_member_function ( const string &  linkage_name) const

Find a method, using its linkage name as a key.

Parameters
linkage_namethe linkage name of the method to find.
Returns
the method found, or nil if none was found.

Definition at line 23660 of file abg-ir.cc.

◆ find_member_function_from_signature() [1/2]

method_decl * find_member_function_from_signature ( const string &  s)

Find a method (member function) using its signature (pretty representation) as a key.

Parameters
sthe signature of the method.
Returns
the method found, or nil if none was found.

Definition at line 23714 of file abg-ir.cc.

◆ find_member_function_from_signature() [2/2]

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.

Parameters
sthe signature of the method.
Returns
the method found, or nil if none was found.

Definition at line 23702 of file abg-ir.cc.

◆ find_member_function_sptr()

method_decl_sptr find_member_function_sptr ( const string &  linkage_name)

Find a method, using its linkage name as a key.

Parameters
linkage_namethe linkage name of the method to find.
Returns
the method found, or nil if none was found.

Definition at line 23686 of file abg-ir.cc.

◆ get_alignment_in_bits()

size_t get_alignment_in_bits ( ) const
virtual

Getter of the alignment of the class_or_union type.

If this class_or_union is a declaration of a definition that is elsewhere, then the size of the definition is returned.

Returns
the alignment of the class_or_union type.

Reimplemented from type_base.

Definition at line 23342 of file abg-ir.cc.

◆ get_data_members()

const class_or_union::data_members & get_data_members ( ) const

Get the data members of this class_or_union.

Returns
a vector of the data members of this class_or_union.

Definition at line 23515 of file abg-ir.cc.

◆ get_member_class_templates()

const member_class_templates & get_member_class_templates ( ) const

Get the member class templates of this class.

Returns
a vector of the member class templates of this class.

Definition at line 23734 of file abg-ir.cc.

◆ get_member_function_templates()

const member_function_templates & get_member_function_templates ( ) const

Get the member function templates of this class.

Returns
a vector of the member function templates of this class.

Definition at line 23727 of file abg-ir.cc.

◆ get_member_functions()

const class_or_union::member_functions & get_member_functions ( ) const

Get the member functions of this class_or_union.

Returns
a vector of the member functions of this class_or_union.

Definition at line 23651 of file abg-ir.cc.

◆ get_non_static_data_members()

const class_or_union::data_members & get_non_static_data_members ( ) const

Get the non-static data memebers of this class_or_union.

Returns
a vector of the non-static data members of this class_or_union.

Definition at line 23606 of file abg-ir.cc.

◆ get_num_anonymous_member_classes()

size_t get_num_anonymous_member_classes ( ) const
virtual

Get the number of anonymous member classes contained in this class.

Returns
the number of anonymous member classes contained in this class.

Reimplemented from scope_decl.

Definition at line 23405 of file abg-ir.cc.

◆ get_num_anonymous_member_enums()

size_t get_num_anonymous_member_enums ( ) const
virtual

Get the number of anonymous member enums contained in this class.

Returns
the number of anonymous member enums contained in this class.

Reimplemented from scope_decl.

Definition at line 23441 of file abg-ir.cc.

◆ get_num_anonymous_member_unions()

size_t get_num_anonymous_member_unions ( ) const
virtual

Get the number of anonymous member unions contained in this class.

Returns
the number of anonymous member unions contained in this class.

Reimplemented from scope_decl.

Definition at line 23423 of file abg-ir.cc.

◆ get_size_in_bits()

size_t get_size_in_bits ( ) const
virtual

Getter of the size of the class_or_union type.

If this class_or_union is a declaration of a definition that is elsewhere, then the size of the definition is returned.

Returns
the size of the class_or_union type.

Reimplemented from type_base.

Definition at line 23390 of file abg-ir.cc.

◆ has_no_member()

bool has_no_member ( ) const
Returns
true iff the current instance has no member.

Definition at line 23768 of file abg-ir.cc.

◆ insert_member_decl()

decl_base_sptr insert_member_decl ( decl_base_sptr  d)
protected

Insert a data member to this class_or_union type.

Parameters
dthe data member to insert.
Returns
the decl that got inserted.

Definition at line 23783 of file abg-ir.cc.

◆ maybe_fixup_members_of_anon_data_member()

void maybe_fixup_members_of_anon_data_member ( var_decl_sptr anon_dm)
protected

Fixup the members of the type of an anonymous data member.

Walk all data members of (the type of) a given anonymous data member and set a particular property of the relationship between each data member and its containing type.

That property records the fact that the data member belongs to the anonymous data member we consider.

In the future, if there are other properties of this relationship to set in this manner, they ought to be added here.

Parameters
anon_dmthe anonymous data member to consider.

Definition at line 23316 of file abg-ir.cc.

◆ operator==() [1/3]

bool operator== ( const class_or_union other) const
virtual

Equality operator.

Parameters
otherthe other class_or_union to compare against.
Returns
true iff other equals the current class_or_union.

Reimplemented in union_decl, and class_decl.

Definition at line 23861 of file abg-ir.cc.

◆ operator==() [2/3]

bool operator== ( const decl_base other) const
virtual

Equality operator.

Parameters
otherthe other class_or_union to compare against.
Returns
true iff other equals the current class_or_union.

Reimplemented from scope_type_decl.

Reimplemented in union_decl, and class_decl.

Definition at line 23817 of file abg-ir.cc.

◆ operator==() [3/3]

bool operator== ( const type_base other) const
virtual

Equality operator.

Parameters
otherthe other class_or_union to compare against.
Returns
true iff other equals the current class_or_union.

Reimplemented from scope_type_decl.

Reimplemented in union_decl, and class_decl.

Definition at line 23847 of file abg-ir.cc.

◆ remove_member_decl()

void remove_member_decl ( decl_base_sptr  decl)
protectedvirtual

Remove a given decl from the current class_or_union scope.

Note that only type declarations are supported by this method for now. Support for the other kinds of declaration is left as an exercise for the interested reader of the code.

Parameters
declthe declaration to remove from this class_or_union scope.

Reimplemented from scope_decl.

Definition at line 23291 of file abg-ir.cc.

◆ set_alignment_in_bits()

void set_alignment_in_bits ( size_t  a)
virtual

Setter of the alignment of the class type.

If this class is a declaration of a definition that is elsewhere, then the new alignment is set to the definition.

Parameters
sthe new alignment.

Reimplemented from type_base.

Definition at line 23358 of file abg-ir.cc.

◆ set_size_in_bits()

void set_size_in_bits ( size_t  s)
virtual

Setter of the size of the class_or_union type.

If this class_or_union is a declaration of a definition that is elsewhere, then the new size is set to the definition.

Parameters
sthe new size.

Reimplemented from type_base.

Definition at line 23374 of file abg-ir.cc.

◆ traverse()

bool traverse ( ir_node_visitor v)
virtual

This implements the ir_traversable_base::traverse pure virtual function.

Parameters
vthe visitor used on the member nodes of the translation unit during the traversal.
Returns
true if the entire IR node tree got traversed, false otherwise.

Reimplemented from scope_type_decl.

Reimplemented in union_decl, and class_decl.

Definition at line 23197 of file abg-ir.cc.

Friends And Related Function Documentation

◆ equals [1/2]

bool equals ( const class_decl ,
const class_decl ,
change_kind  
)
friend

Compares two instances of class_decl.

If the two intances are different, set a bitfield to give some insight about the kind of differences there are.

Parameters
lthe first artifact of the comparison.
rthe second artifact of the comparison.
ka pointer to a bitfield that gives information about the kind of changes there are between l and r. This one is set iff k is non-null and the function returns false.

Please note that setting k to a non-null value does have a negative performance impact because even if l and r are not equal, the function keeps up the comparison in order to determine the different kinds of ways in which they are different.

Returns
true if l equals r, false otherwise.

Definition at line 25522 of file abg-ir.cc.

◆ equals [2/2]

bool equals ( const class_or_union l,
const class_or_union r,
change_kind k 
)
friend

Compares two instances of class_or_union.

If the two intances are different, set a bitfield to give some insight about the kind of differences there are.

Parameters
lthe first artifact of the comparison.
rthe second artifact of the comparison.
ka pointer to a bitfield that gives information about the kind of changes there are between l and r. This one is set iff it's non-null and if the function returns false.

Please note that setting k to a non-null value does have a negative performance impact because even if l and r are not equal, the function keeps up the comparison in order to determine the different kinds of ways in which they are different.

Returns
true if l equals r, false otherwise.

Definition at line 23887 of file abg-ir.cc.

◆ fixup_virtual_member_function

void fixup_virtual_member_function ( method_decl_sptr  method)
friend

When a virtual member function has seen its virtualness set by set_member_function_is_virtual(), this function ensures that the member function is added to the specific vectors and maps of virtual member function of its class.

Parameters
methodthe method to fixup.

Definition at line 25289 of file abg-ir.cc.

◆ set_member_is_static

void set_member_is_static ( decl_base d,
bool  s 
)
friend

Sets the static-ness property of a class member.

Parameters
dthe class member to set the static-ness property for. Note that this must be a class member otherwise the function aborts the current process.
sthis must be true if the member is to be static, false otherwise.

Definition at line 26245 of file abg-ir.cc.


The documentation for this class was generated from the following files: