libabigail
Public Member Functions | Protected Types | Protected Member Functions | Friends | List of all members
type_or_decl_base Class Referenceabstract

The base class of both types and declarations. More...

#include <abg-ir.h>

Inheritance diagram for type_or_decl_base:
[legend]

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. 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...
 
virtual string get_pretty_representation (bool internal=false, bool qualified_name=true) const =0
 
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...
 
virtual bool traverse (ir_node_visitor &)
 Traverse the the ABI artifact. More...
 
- Public Member Functions inherited from traversable_base
virtual ~traversable_base ()
 Destructor of the traversable_base type. More...
 

Protected 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 , QUALIFIED_TYPE , POINTER_TYPE , REFERENCE_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

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

Friends

class_declis_class_type (const type_or_decl_base *)
 Test whether a type is a class. More...
 
decl_baseis_decl (const type_or_decl_base *d)
 Test if an ABI artifact is a declaration. More...
 
pointer_type_defis_pointer_type (type_or_decl_base *)
 Test whether a type is a pointer_type_def. More...
 
type_baseis_type (const type_or_decl_base *)
 Test whether a declaration is a type. More...
 
type_or_decl_base::type_or_decl_kind operator& (type_or_decl_base::type_or_decl_kind, type_or_decl_base::type_or_decl_kind)
 bitwise "AND" operator for the type_or_decl_base::type_or_decl_kind bitmap type. More...
 
type_or_decl_base::type_or_decl_kindoperator&= (type_or_decl_base::type_or_decl_kind &, type_or_decl_base::type_or_decl_kind)
 bitwise "A&=" operator for the type_or_decl_base::type_or_decl_kind bitmap type. More...
 
type_or_decl_base::type_or_decl_kind operator| (type_or_decl_base::type_or_decl_kind, type_or_decl_base::type_or_decl_kind)
 bitwise "OR" operator for the type_or_decl_base::type_or_decl_kind bitmap type. More...
 
type_or_decl_base::type_or_decl_kindoperator|= (type_or_decl_base::type_or_decl_kind &, type_or_decl_base::type_or_decl_kind)
 bitwise "|=" operator for the type_or_decl_base::type_or_decl_kind bitmap type. More...
 

Detailed Description

The base class of both types and declarations.

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

Member Enumeration Documentation

◆ type_or_decl_kind

enum type_or_decl_kind
protected

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.

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

Constructor & Destructor Documentation

◆ type_or_decl_base()

type_or_decl_base ( const environment e,
enum type_or_decl_kind  k = ABSTRACT_TYPE_OR_DECL 
)

Constructor of type_or_decl_base.

Parameters
theenvironment the current ABI artifact is constructed from.
kthe runtime identifier bitmap of the type being built.

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

◆ ~type_or_decl_base()

~type_or_decl_base ( )
virtual

The destructor of the type_or_decl_base type.

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

Member Function Documentation

◆ get_artificial_location()

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.

Returns
the new artificial location.

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

◆ get_corpus() [1/2]

corpus * get_corpus ( )

Get the corpus this ABI artifact belongs to.

Returns
the corpus this ABI artifact belongs to, or nil if it belongs to none for now.

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

◆ get_corpus() [2/2]

const corpus * get_corpus ( ) const

Get the corpus this ABI artifact belongs to.

Returns
the corpus this ABI artifact belongs to, or nil if it belongs to none for now.

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

◆ get_environment()

const environment & get_environment ( ) const

Getter of the environment of the current ABI artifact.

Returns
the environment of the artifact.

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

◆ get_is_artificial()

bool get_is_artificial ( ) const

Getter of the flag that says if the artefact is artificial.

Being artificial means it was not explicitely mentionned in the source code, but was rather artificially created by the compiler or libabigail.

Returns
true iff the declaration is artificial.

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

◆ get_translation_unit() [1/2]

translation_unit * get_translation_unit ( )

Get the translation_unit this ABI artifact belongs to.

Returns
the translation unit this ABI artifact belongs to, or nil if belongs to none for now.

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

◆ get_translation_unit() [2/2]

const translation_unit * get_translation_unit ( ) const

Get the translation_unit this ABI artifact belongs to.

Returns
the translation unit this ABI artifact belongs to, or nil if belongs to none for now.

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

◆ has_artificial_location()

bool has_artificial_location ( ) const

Test if the current ABI artifact carries an artificial location.

Returns
true iff the current ABI artifact carries an artificial location.

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

◆ hashing_started() [1/2]

bool hashing_started ( ) const
protected

Getter for the 'hashing_started' property.

Returns
the 'hashing_started' property.

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

◆ hashing_started() [2/2]

void hashing_started ( bool  b) const
protected

Setter for the 'hashing_started' property.

Parameters
bthe value to set the 'hashing_property' to.

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

◆ kind() [1/2]

enum type_or_decl_base::type_or_decl_kind kind ( ) const
protected

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.

Returns
the runtime type identifier bitmap of the current ABI artifact.

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

◆ kind() [2/2]

void kind ( enum type_or_decl_kind  k)
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.

Parameters
theruntime type identifier bitmap of the current ABI artifact.

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

◆ runtime_type_instance() [1/3]

void * runtime_type_instance ( )
protected

Getter of the pointer to the runtime type sub-object of the current instance.

Returns
the pointer to the runtime type sub-object of the current instance.

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

◆ runtime_type_instance() [2/3]

const void * runtime_type_instance ( ) const
protected

Getter of the pointer to the runtime type sub-object of the current instance.

Returns
the pointer to the runtime type sub-object of the current instance.

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

◆ runtime_type_instance() [3/3]

void runtime_type_instance ( void *  i)
protected

Setter of the pointer to the runtime type sub-object of the current instance.

Parameters
ithe new pointer to the runtime type sub-object of the current instance.

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

◆ set_artificial_location()

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.

Parameters
lthe new artificial location.

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

◆ set_is_artificial()

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.

Parameters
fthe new value of the flag that says if the artefact is artificial.

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

◆ set_translation_unit()

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.

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

◆ traverse()

bool traverse ( ir_node_visitor )
virtual

◆ type_or_decl_base_pointer() [1/2]

void * type_or_decl_base_pointer ( )
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.

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

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

◆ type_or_decl_base_pointer() [2/2]

const void * type_or_decl_base_pointer ( ) const
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.

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

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

Friends And Related Function Documentation

◆ is_class_type

class_decl* is_class_type ( const type_or_decl_base )
friend

Test whether a type is a class.

@parm t the type to consider.

Returns
the class_decl if t is a class_decl or null otherwise.

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

◆ is_decl

decl_base* is_decl ( const type_or_decl_base d)
friend

Test if an ABI artifact is a declaration.

Parameters
dthe artifact to consider.
returnthe declaration sub-object of d if it's a declaration, or NULL if it is not.

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

◆ is_pointer_type

pointer_type_def* is_pointer_type ( type_or_decl_base )
friend

Test whether a type is a pointer_type_def.

Parameters
tthe type to test.
Returns
the pointer_type_def_sptr if t is a pointer_type_def, null otherwise.

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

◆ is_type

type_base* is_type ( const type_or_decl_base )
friend

Test whether a declaration is a type.

Parameters
dthe IR artefact to test for.
Returns
true if the artifact is a type, false otherwise.

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

◆ operator&

bitwise "AND" operator for the type_or_decl_base::type_or_decl_kind bitmap type.

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

◆ operator&=

bitwise "A&=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.

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

◆ operator|

bitwise "OR" operator for the type_or_decl_base::type_or_decl_kind bitmap type.

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

◆ operator|=

bitwise "|=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.

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


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