libabigail
|
An abstraction helper for type declarations. More...
#include <abg-ir.h>
Classes | |
struct | dynamic_hash |
struct | hash |
Hash functor for instances of type_base. More... | |
struct | priv |
Definition of the private data of type_base. More... | |
struct | shared_ptr_hash |
Public Member Functions | |
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 bool | operator== (const type_base &) const |
Return true iff both type declarations are equal. 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... | |
virtual bool | traverse (ir_node_visitor &) |
Default implementation of traversal for types. This function does nothing. It must be implemented by every single new type that is written. 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... | |
virtual string | get_pretty_representation (bool internal=false, bool qualified_name=true) const =0 |
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... | |
Public Attributes | |
priv * | priv_ |
Protected Member Functions | |
virtual void | on_canonical_type_set () |
This method is invoked automatically right after the current instance of class_decl has been 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... | |
Friends | |
type_base_sptr | canonicalize (type_base_sptr) |
Compute the canonical type of a given type. 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... | |
type_base | ( | const environment & | e, |
size_t | s, | ||
size_t | a | ||
) |
|
virtual |
Getter for the alignment of the type.
Reimplemented in class_or_union, and typedef_decl.
const interned_string & get_cached_pretty_representation | ( | bool | internal = false | ) | const |
Get the pretty representation of the current type.
The pretty representation is retrieved from a cache. If the cache is empty, this function computes the pretty representation, put it in the cache and returns it.
Note that if the type is *NOT* canonicalized, the pretty representation is never cached.
internal | if true, then the pretty representation is to be used for purpuses that are internal to the libabigail library itself. If you don't know what this means, then you probably should set this parameter to "false". |
type_base_sptr get_canonical_type | ( | ) | const |
type_base * get_naked_canonical_type | ( | ) | const |
Getter of the canonical type pointer.
Note that this function doesn't return a smart pointer, but rather the underlying pointer managed by the smart pointer. So it's as fast as possible. This getter is to be used in code paths that are proven to be performance hot spots; especially, when comparing sensitive types like class, function, pointers and reference types. Those are compared extremely frequently and thus, their accessing the canonical type must be fast.
|
virtual |
Getter for the size of the type.
Reimplemented in class_or_union, typedef_decl, and qualified_type_def.
|
protectedvirtual |
This method is invoked automatically right after the current instance of class_decl has been canonicalized.
Reimplemented in class_decl, function_type, reference_type_def, pointer_type_def, and qualified_type_def.
|
virtual |
Inequality operator.
other | the instance of type_base to compare the current instance against. |
other
. Reimplemented in array_type_def::subrange_type, and type_decl.
|
virtual |
Return true iff both type declarations are equal.
Note that this doesn't test if the scopes of both types are equal.
Reimplemented in union_decl, class_decl, class_or_union, template_tparameter, type_tparameter, function_type, typedef_decl, enum_type_decl, array_type_def, array_type_def::subrange_type, ptr_to_mbr_type, reference_type_def, pointer_type_def, qualified_type_def, scope_type_decl, and type_decl.
|
virtual |
Setter for the alignment of the type.
a | the new alignment – in bits. |
Reimplemented in class_or_union.
|
virtual |
Setter for the size of the type.
s | the new size – in bits. |
Reimplemented in class_or_union.
|
virtual |
Default implementation of traversal for types. This function does nothing. It must be implemented by every single new type that is written.
Please look at e.g, class_decl::traverse() for an example of how to implement this.
v | the visitor used to visit the type. |
Reimplemented from type_or_decl_base.
Reimplemented in union_decl, class_decl, class_or_union, enum_type_decl, array_type_def, ptr_to_mbr_type, reference_type_def, pointer_type_def, qualified_type_def, function_type, typedef_decl, array_type_def::subrange_type, scope_type_decl, and type_decl.
|
friend |
Compute the canonical type of a given type.
It means that after invoking this function, comparing the intance instance type_base and another one (on which type_base::enable_canonical_equality() would have been invoked as well) is performed by just comparing the pointer values of the canonical types of both types. That equality comparison is supposedly faster than structural comparison of the types.
t | a smart pointer to the instance of type_base for which to compute the canonical type. After this call, t->get_canonical_type() will return the newly computed canonical type. |
t
.