libabigail
|
The base class of both types and declarations. More...
#include <abg-ir.h>
Classes | |
struct | priv |
The private data of type_or_decl_base. More... | |
Public Types | |
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... | |
Public Member Functions | |
type_or_decl_base (const environment &, enum type_or_decl_kind k=ABSTRACT_TYPE_OR_DECL) | |
Constructor of type_or_decl_base. | |
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. | |
corpus * | get_corpus () |
Get the corpus this ABI artifact belongs to. | |
const corpus * | get_corpus () const |
Get the corpus this ABI artifact belongs to. | |
const environment & | get_environment () const |
Getter of the environment of the current ABI artifact. | |
bool | get_is_artificial () const |
Getter of the flag that says if the artefact is artificial. | |
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. | |
const translation_unit * | get_translation_unit () const |
Get the translation_unit this ABI artifact belongs to. | |
bool | has_artificial_location () const |
Test if the current ABI artifact carries an artificial location. | |
enum type_or_decl_kind | kind () const |
Getter for the "kind" property of type_or_decl_base type. | |
void | set_artificial_location (const location &) |
Setter of the artificial location of the artificat. | |
void | set_is_artificial (bool) |
Setter of the flag that says if the artefact is artificial. | |
void | set_translation_unit (translation_unit *) |
Set the translation_unit this ABI artifact belongs to. | |
virtual bool | traverse (ir_node_visitor &) |
Traverse the the ABI artifact. | |
![]() | |
virtual | ~traversable_base () |
Destructor of the traversable_base type. | |
Public Attributes | |
std::unique_ptr< priv > | priv_ |
Protected Member Functions | |
virtual hash_t | hash_value () const |
Return the hash value of the current IR node. | |
void | kind (enum type_or_decl_kind) |
Setter for the "kind" property of type_or_decl_base type. | |
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. | |
const void * | runtime_type_instance () const |
Getter of the pointer to the runtime type sub-object of the current instance. | |
void | runtime_type_instance (void *) |
Setter of the pointer to the runtime type sub-object of the current instance. | |
void | set_hash_value (hash_t) const |
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. | |
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. | |
![]() | |
traversable_base () | |
Default constructor of the traversable_base type. | |
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. | |
void | visiting (bool f) |
The traversing code should be responsible of calling this, not the user code. | |
enum type_or_decl_kind |
type_or_decl_base | ( | const environment & | e, |
enum type_or_decl_kind | k = ABSTRACT_TYPE_OR_DECL ) |
Constructor of type_or_decl_base.
the | environment the current ABI artifact is constructed from. |
k | the runtime identifier bitmap of the type being built. |
|
virtual |
The destructor of the type_or_decl_base type.
location & get_artificial_location | ( | ) | const |
Getter of the artificial location of the artifact.
The artificial location is a location that was artificially generated by libabigail, not generated by the original emitter of the ABI meta-data. For instance, when reading an XML element from an abixml file, the artificial location is the source location of the XML element within the file, not the value of the 'location'property that might be carried by the element.
Artificial locations might be useful to ensure that the abixml emitted by the abixml writer is sorted the same way as the input abixml read by the reader.
corpus * get_corpus | ( | ) |
const corpus * get_corpus | ( | ) | const |
const environment & get_environment | ( | ) | const |
bool get_is_artificial | ( | ) | const |
|
pure virtual |
translation_unit * get_translation_unit | ( | ) |
Get the translation_unit this ABI artifact belongs to.
const translation_unit * get_translation_unit | ( | ) | const |
Get the translation_unit this ABI artifact belongs to.
bool has_artificial_location | ( | ) | const |
|
protectedvirtual |
Return the hash value of the current IR node.
Note that upon the first invocation, this member functions computes the hash value and returns it. Subsequent invocations just return the hash value that was previously calculated.
Reimplemented in array_type_def, array_type_def::subrange_type, class_decl::base_spec, class_decl, class_or_union, enum_type_decl, function_type, method_type, pointer_type_def, ptr_to_mbr_type, qualified_type_def, reference_type_def, type_base, type_decl, typedef_decl, and union_decl.
enum type_or_decl_base::type_or_decl_kind kind | ( | ) | const |
Getter for the "kind" property of type_or_decl_base type.
This property holds the identifier bitmap of the runtime type of an ABI artifact.
|
protected |
Setter for the "kind" property of type_or_decl_base type.
This property holds the identifier bitmap of the runtime type of an ABI artifact.
the | runtime type identifier bitmap of the current ABI artifact. |
|
protected |
|
protected |
|
protected |
void set_artificial_location | ( | const location & | l | ) |
Setter of the artificial location of the artificat.
The artificial location is a location that was artificially generated by libabigail, not generated by the original emitter of the ABI meta-data. For instance, when reading an XML element from an abixml file, the artificial location is the source location of the XML element within the file, not the value of the 'location'property that might be carried by the element.
Artificial locations might be useful to ensure that abixml emitted by the abixml writer are sorted the same way as the input abixml read by the reader.
l | the new artificial location. |
void set_is_artificial | ( | bool | f | ) |
Setter of the flag that says if the artefact is artificial.
Being artificial means the artefact was not explicitely mentionned in the source code, but was rather artificially created by the compiler or by libabigail.
f | the new value of the flag that says if the artefact is artificial. |
void set_translation_unit | ( | translation_unit * | tu | ) |
Set the translation_unit this ABI artifact belongs to.
Note that adding an ABI artifact to a containining on should invoke this member function.
|
virtual |
Traverse the the ABI artifact.
v | the visitor used to traverse the sub-tree nodes of the artifact. |
Reimplemented from ir_traversable_base.
Reimplemented in function_decl::parameter, function_decl, array_type_def::subrange_type, array_type_def, class_decl::base_spec, class_decl, class_or_union, class_tdecl, decl_base, enum_type_decl, function_decl::parameter, function_decl, function_tdecl, function_type, member_class_template, member_function_template, namespace_decl, pointer_type_def, ptr_to_mbr_type, qualified_type_def, reference_type_def, scope_decl, scope_type_decl, type_base, type_decl, typedef_decl, union_decl, and var_decl.
|
protected |
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.
|
protected |
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.
|
friend |
Test whether a type is a class.
@parm t the type to consider.
t
is a class_decl or null otherwise.
|
friend |
|
friend |
|
friend |
bitwise "AND" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
|
friend |
bitwise "A&=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
|
friend |
bitwise "OR" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
|
friend |
bitwise "|=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
|
friend |
Get the hash value associated to an IR node.
Unlike type_or_decl_base::hash_value(), if the IR has no associated hash value, an empty hash value is returned.
artefact | the IR node to consider. |
artefact
.
|
friend |
Set the hash value of an IR node and return it.
If the IR node already has a hash value set, this function just returns it. Otherwise, the function computes a new hash value and sets it to the IR node.
Note that if the IR node is a non-canonicalizeable type, no hash value is computed and an empty hash is returned.
This is a sub-routine of the type_or_decl_base::hash_value() virtual member functions.
type_or_decl | the IR node to compute the value for. |
Definition at line 414 of file abg-ir-priv.h.