libabigail
|
Abstracts the type of a class member function. More...
#include <abg-ir.h>
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_string & | get_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 parameters & | get_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_string & | get_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_base * | get_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... | |
location & | get_artificial_location () const |
Getter of the artificial location of the artifact. More... | |
corpus * | get_corpus () |
Get the corpus this ABI artifact belongs to. More... | |
const corpus * | get_corpus () const |
Get the corpus this ABI artifact belongs to. More... | |
const environment & | get_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_unit * | get_translation_unit () |
Get the translation_unit this ABI artifact belongs to. More... | |
const translation_unit * | get_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::parameter > | parameter_sptr |
Convenience typedef for a shared pointer on a function_decl::parameter. More... | |
typedef std::vector< parameter_sptr > | parameters |
Convenience typedef for a vector of parameter_sptr. More... | |
Public Attributes inherited from function_type | |
std::unique_ptr< priv > | priv_ |
Public Attributes inherited from type_base | |
priv * | priv_ |
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_base & | operator= (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... | |
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.
return_type | the type of the return value of the method. |
class_type | the base type of the method type. That is, the type of the class the method belongs to. |
p | the vector of the parameters of the method. |
is_const | whether 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_bits | the size of an instance of method_type, expressed in bits. |
alignment_in_bits | the alignment of an instance of method_type, expressed in bits. |
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.
return_type | the type of the return value of the method. |
class_type | the 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. |
p | the vector of the parameters of the method type. |
is_const | whether 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_bits | the size of an instance of method_type, expressed in bits. |
alignment_in_bits | the alignment of an instance of method_type, expressed in bits. |
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
class_typ | the base type of the method type. That is, the type of the class (or union) the method belongs to. |
size_in_bits | the size of an instance of method_type, expressed in bits. |
alignment_in_bits | the alignment of an instance of method_type, expressed in bits. |
method_type | ( | const environment & | env, |
size_t | size_in_bits, | ||
size_t | alignment_in_bits | ||
) |
Constructor of the qualified_type_def.
env | the environment we are operating from. |
size_in_bits | the size of the type, expressed in bits. |
alignment_in_bits | the alignment of the type, expressed in bits |
|
virtual |
The destructor of method_type.
class_or_union_sptr get_class_type | ( | ) | const |
bool get_is_const | ( | ) | const |
Getter of the "is-const" property of method_type.
|
virtual |
Return a copy of the pretty representation of the current method_type.
internal | set 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.
Reimplemented from function_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.
t | the new class type to set. |
void set_is_const | ( | bool | f | ) |
Setter of the "is-const" property of method_type.
the | new value of the "is-const" property. |
|
friend |
Get the name of a given method type and return a copy of it.
fn_type | the function type to consider. |
internal | set 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. |