libabigail
Public Member Functions | Friends | List of all members
method_type Class Reference

Abstracts the type of a class member function. More...

#include <abg-ir.h>

Inheritance diagram for method_type:
[legend]

Public Member Functions

 method_type (class_or_union_sptr class_type, bool is_const, size_t size_in_bits, size_t alignment_in_bits)
 Constructor of instances of method_type. More...
 
 method_type (const environment &env, size_t size_in_bits, size_t alignment_in_bits)
 Constructor of the qualified_type_def. More...
 
 method_type (type_base_sptr return_type, class_or_union_sptr class_type, const std::vector< function_decl::parameter_sptr > &parms, bool is_const, size_t size_in_bits, size_t alignment_in_bits)
 Constructor for instances of method_type. More...
 
 method_type (type_base_sptr return_type, type_base_sptr class_type, const std::vector< function_decl::parameter_sptr > &parms, bool is_const, size_t size_in_bits, size_t alignment_in_bits)
 Constructor of instances of method_type. More...
 
virtual ~method_type ()
 The destructor of method_type. More...
 
class_or_union_sptr get_class_type () const
 Get the class type this method belongs to. More...
 
bool get_is_const () const
 Getter of the "is-const" property of method_type. More...
 
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. More...
 
void set_class_type (const class_or_union_sptr &t)
 Sets the class type of the current instance of method_type. More...
 
void set_is_const (bool)
 Setter of the "is-const" property of method_type. More...
 
- Public Member Functions inherited from function_type
 function_type (const environment &env, size_t size_in_bits, size_t alignment_in_bits)
 A constructor for a function_type that takes no parameter and that has no return_type yet. These missing parts can (and must) be added later. More...
 
 function_type (type_base_sptr return_type, const parameters &parms, size_t size_in_bits, size_t alignment_in_bits)
 The most straightforward constructor for the function_type class. More...
 
 function_type (type_base_sptr return_type, size_t size_in_bits, size_t alignment_in_bits)
 A constructor for a function_type that takes no parameters. More...
 
void append_parameter (parameter_sptr parm)
 Append a new parameter to the vector of parameters of the current instance of function_type. More...
 
const interned_stringget_cached_name (bool internal=false) const
 Get the name of the current function_type. More...
 
parameters::const_iterator get_first_non_implicit_parm () const
 Get the first parameter of the function. More...
 
parameters::const_iterator get_first_parm () const
 Get the first parameter of the function. More...
 
const parametersget_parameters () const
 Getter for the set of parameters of the current intance of function_type. More...
 
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. More...
 
type_base_sptr get_return_type () const
 Getter for the return type of the current instance of function_type. More...
 
bool is_variadic () const
 Test if the current instance of function_type is for a variadic function. More...
 
virtual bool operator== (const type_base &) const
 Equality operator for function_type. More...
 
void set_parameters (const parameters &p)
 Setter for the parameters of the current instance of function_type. More...
 
void set_return_type (type_base_sptr t)
 Setter of the return type of the current instance of function_type. More...
 
virtual bool traverse (ir_node_visitor &)
 Traverses an instance of function_type, visiting all the sub-types and decls that it might contain. 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...
 
virtual size_t get_alignment_in_bits () const
 Getter for the alignment of the type. 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 size_t get_size_in_bits () const
 Getter for the size of the type. More...
 
virtual bool operator!= (const type_base &) const
 Inequality operator. More...
 
virtual void set_alignment_in_bits (size_t)
 Setter for the alignment of the type. More...
 
virtual void set_size_in_bits (size_t)
 Setter for the size of the type. 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...
 

Friends

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. More...
 

Additional Inherited Members

- Public Types inherited from function_type
typedef shared_ptr< function_decl::parameterparameter_sptr
 Convenience typedef for a shared pointer on a function_decl::parameter. More...
 
typedef std::vector< parameter_sptrparameters
 Convenience typedef for a vector of parameter_sptr. More...
 
- Public Attributes inherited from function_type
std::unique_ptr< privpriv_
 
- Public Attributes inherited from type_base
privpriv_
 
- 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...
 
- Protected Member Functions inherited from function_type
virtual void on_canonical_type_set ()
 This function is automatically invoked whenever an instance of this type is canonicalized. 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...
 

Detailed Description

Abstracts the type of a class member function.

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

Constructor & Destructor Documentation

◆ method_type() [1/4]

method_type ( type_base_sptr  return_type,
class_or_union_sptr  class_type,
const std::vector< function_decl::parameter_sptr > &  p,
bool  is_const,
size_t  size_in_bits,
size_t  alignment_in_bits 
)

Constructor for instances of method_type.

Instances of method_decl must be of type method_type.

Parameters
return_typethe type of the return value of the method.
class_typethe base type of the method type. That is, the type of the class the method belongs to.
pthe vector of the parameters of the method.
is_constwhether this method type is for a const method. Note that const-ness is a property of the method *type* and of the relationship between a method *declaration* and its scope.
size_in_bitsthe size of an instance of method_type, expressed in bits.
alignment_in_bitsthe alignment of an instance of method_type, expressed in bits.

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

◆ method_type() [2/4]

method_type ( type_base_sptr  return_type,
type_base_sptr  class_type,
const std::vector< function_decl::parameter_sptr > &  p,
bool  is_const,
size_t  size_in_bits,
size_t  alignment_in_bits 
)

Constructor of instances of method_type.

Instances of method_decl must be of type method_type.

Parameters
return_typethe type of the return value of the method.
class_typethe type of the class the method belongs to. The actual (dynamic) type of class_type must be a pointer class_type. We are setting it to pointer to type_base here to help client code that is compiled without rtti and thus cannot perform dynamic casts.
pthe vector of the parameters of the method type.
is_constwhether this method type is for a const method. Note that const-ness is a property of the method *type* and of the relationship between a method *declaration* and its scope.
size_in_bitsthe size of an instance of method_type, expressed in bits.
alignment_in_bitsthe alignment of an instance of method_type, expressed in bits.

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

◆ method_type() [3/4]

method_type ( class_or_union_sptr  class_type,
bool  is_const,
size_t  size_in_bits,
size_t  alignment_in_bits 
)

Constructor of instances of method_type.

When constructed with this constructor, and instane of method_type must set a return type using method_type::set_return_type

Parameters
class_typthe base type of the method type. That is, the type of the class (or union) the method belongs to.
size_in_bitsthe size of an instance of method_type, expressed in bits.
alignment_in_bitsthe alignment of an instance of method_type, expressed in bits.

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

◆ method_type() [4/4]

method_type ( const environment env,
size_t  size_in_bits,
size_t  alignment_in_bits 
)

Constructor of the qualified_type_def.

Parameters
envthe environment we are operating from.
size_in_bitsthe size of the type, expressed in bits.
alignment_in_bitsthe alignment of the type, expressed in bits

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

◆ ~method_type()

~method_type ( )
virtual

The destructor of method_type.

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

Member Function Documentation

◆ get_class_type()

class_or_union_sptr get_class_type ( ) const

Get the class type this method belongs to.

Returns
the class type.

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

◆ get_is_const()

bool get_is_const ( ) const

Getter of the "is-const" property of method_type.

Returns
true iff the "is-const" property was set.

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

◆ get_pretty_representation()

string get_pretty_representation ( bool  internal = false,
bool  qualified_name = true 
) const
virtual

Return a copy of the pretty representation of the current method_type.

Parameters
internalset to true if the call is intended to get a representation of the decl (or type) for the purpose of canonical type comparison. This is mainly used in the function type_base::get_canonical_type_for().

In other words if the argument for this parameter is true then the call is meant for internal use (for technical use inside the library itself), false otherwise. If you don't know what this is for, then set it to false.

Returns
a copy of the pretty representation of the current method_type.

Reimplemented from function_type.

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

◆ set_class_type()

void set_class_type ( const class_or_union_sptr &  t)

Sets the class type of the current instance of method_type.

The class type is the type of the class the method belongs to.

Parameters
tthe new class type to set.

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

◆ set_is_const()

void set_is_const ( bool  f)

Setter of the "is-const" property of method_type.

Parameters
thenew value of the "is-const" property.

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

Friends And Related Function Documentation

◆ get_method_type_name

interned_string get_method_type_name ( const method_type fn_type,
bool  internal 
)
friend

Get the name of a given method type and return a copy of it.

Parameters
fn_typethe function type to consider.
internalset to true if the call is intended for an internal use (for technical use inside the library itself), false otherwise. If you don't know what this is for, then set it to false.
Returns
a copy of the function type name

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


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