libabigail
Loading...
Searching...
No Matches
real_type Class Reference

The internal representation of an integral type. More...

#include <abg-ir-priv.h>

Public Types

enum  base_type {
  INT_BASE_TYPE , CHAR_BASE_TYPE , BOOL_BASE_TYPE , DOUBLE_BASE_TYPE ,
  FLOAT_BASE_TYPE , CHAR16_T_BASE_TYPE , CHAR32_T_BASE_TYPE , WCHAR_T_BASE_TYPE ,
  SIZE_BASE_TYPE , SSIZE_BASE_TYPE , BIT_SIZE_BASE_TYPE , SBIT_SIZE_BASE_TYPE ,
  ARRAY_SIZE_BASE_TYPE
}
 The possible base types of integral types. We might have forgotten many of these, so do not hesitate to add new ones. More...
 
enum  modifiers_type {
  NO_MODIFIER , SIGNED_MODIFIER , UNSIGNED_MODIFIER , SHORT_MODIFIER ,
  LONG_MODIFIER , LONG_LONG_MODIFIER
}
 The modifiers of the base types above. Several modifiers can be combined for a given base type. The presence of modifiers is usually modelled by a bitmap of modifiers. More...
 

Public Member Functions

 real_type ()
 Default constructor of the real_type.
 
 real_type (base_type, modifiers_type)
 Constructor of the real_type.
 
 real_type (const string &name)
 Constructor of the real_type.
 
base_type get_base_type () const
 Getter of the base type of the real_type.
 
modifiers_type get_modifiers () const
 Getter of the modifiers bitmap of the real_type.
 
 operator string () const
 Convert the current instance of real_type into its string representation.
 
bool operator== (const real_type &) const
 Equality operator for the real_type.
 
void set_modifiers (modifiers_type)
 Setter of the modifiers bitmap of the real_type.
 
string to_string (bool internal=false) const
 Return the string representation of the current instance of real_type.
 

Detailed Description

The internal representation of an integral type.

This is a "utility type" used internally to canonicalize the name of fundamental integral types, so that "unsignd long" and "long unsined int" end-up having the same name.

Definition at line 47 of file abg-ir-priv.h.

Member Enumeration Documentation

◆ base_type

enum base_type

The possible base types of integral types. We might have forgotten many of these, so do not hesitate to add new ones.

If you do add new ones, please also consider updating functions parse_base_real_type and real_type::to_string.

Enumerator
INT_BASE_TYPE 

The "int" base type.

CHAR_BASE_TYPE 

The "char" base type.

BOOL_BASE_TYPE 

The "bool" base type in C++ or "_Bool" in C11.

DOUBLE_BASE_TYPE 

The "double" base type.

FLOAT_BASE_TYPE 

The "float" base type.

CHAR16_T_BASE_TYPE 

The "char16_t base type.

CHAR32_T_BASE_TYPE 

The "char32_t" base type.

WCHAR_T_BASE_TYPE 

The "wchar_t" base type.

ARRAY_SIZE_BASE_TYPE 

The aray size type used by Clang.

Definition at line 55 of file abg-ir-priv.h.

◆ modifiers_type

The modifiers of the base types above. Several modifiers can be combined for a given base type. The presence of modifiers is usually modelled by a bitmap of modifiers.

If you add a new modifier, please consider updating functions parse_real_type_modifier and real_type::to_string.

Enumerator
SIGNED_MODIFIER 

The "signed" modifier.

UNSIGNED_MODIFIER 

The "unsigned" modier.

SHORT_MODIFIER 

The "short" modifier.

LONG_MODIFIER 

The "long" modifier.

LONG_LONG_MODIFIER 

The "long long" modifier.

Definition at line 87 of file abg-ir-priv.h.

Constructor & Destructor Documentation

◆ real_type() [1/3]

real_type ( )

Default constructor of the real_type.

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

◆ real_type() [2/3]

real_type ( const string & type_name)

Constructor of the real_type.

Parameters
thename of the real type to parse to initialize the current instance of real_type.

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

◆ real_type() [3/3]

Constructor of the real_type.

Parameters
bthe base type of the real type.
mthe modifiers of the real type.

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

Member Function Documentation

◆ get_base_type()

real_type::base_type get_base_type ( ) const

Getter of the base type of the real_type.

Returns
the base type of the real_type.

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

◆ get_modifiers()

real_type::modifiers_type get_modifiers ( ) const

Getter of the modifiers bitmap of the real_type.

Returns
the modifiers bitmap of the real_type.

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

◆ operator string()

operator string ( ) const

Convert the current instance of real_type into its string representation.

Returns
the string representation of the current instance of real_type.

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

◆ operator==()

bool operator== ( const real_type & other) const

Equality operator for the real_type.

Parameters
otherthe other real type to compare against.
Returns
true iff other equals the current instance of real_type.

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

◆ set_modifiers()

void set_modifiers ( modifiers_type m)

Setter of the modifiers bitmap of the real_type.

Parameters
mthe new modifiers.

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

◆ to_string()

string to_string ( bool internal = false) const

Return the string representation of the current instance of real_type.

Parameters
internalif true the string representation is to be used for internal purposes. In general, it means it's for type canonicalization purposes.
Returns
the string representation of the current instance of real_type.

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


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