ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
irep2_type.h File Reference
#include <optional>
#include <irep2/irep2.h>
#include <irep2/type_kinds.inc>
Include dependency graph for irep2_type.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  bool_type2t
 Boolean type. More...
class  empty_type2t
 Empty type. More...
class  symbol_type2t
 Symbolic type. More...
class  struct_type2t
 Struct type. More...
class  union_type2t
 Union type. More...
class  unsignedbv_type2t
 Unsigned integer type. More...
class  signedbv_type2t
 Signed integer type. More...
class  code_type2t
 Type of functions. More...
class  array_type2t
 Array type. More...
class  array_type2t::array_size_excp
 Common base for the two array-sizing exceptions thrown by array_type2t::get_width (and friends). More...
class  array_type2t::inf_sized_array_excp
 Exception for invalid manipulations of an infinitely sized array. More...
class  array_type2t::dyn_sized_array_excp
 Exception for invalid manipulations of dynamically sized arrays. More...
class  vector_type2t
 Vector type. More...
class  pointer_type2t
 Pointer type. More...
class  fixedbv_type2t
 Fixed bitvector type. More...
class  floatbv_type2t
 Floating-point bitvector type. More...
class  complex_type2t
 Complex number type. More...
class  cpp_name_type2t
 C++ Name type. More...

Macros

#define IREP2_TYPE(kind, pretty)
#define irep_typedefs(basename)
#define type_macros(name)
#define IREP2_TYPE(kind, pretty)

Enumerations

enum class  pointer_ref_kindt { NONE , LVALUE , RVALUE }
 How the source spelled a pointer. More...

Functions

 irep_typedefs (bool)
 irep_typedefs (empty)
 irep_typedefs (symbol)
 irep_typedefs (struct)
 irep_typedefs (union)
 irep_typedefs (unsignedbv)
 irep_typedefs (signedbv)
 irep_typedefs (code)
 irep_typedefs (array)
 irep_typedefs (pointer)
 irep_typedefs (fixedbv)
 irep_typedefs (floatbv)
 irep_typedefs (complex)
 irep_typedefs (cpp_name)
 irep_typedefs (vector)
std::vector< type2tc > struct_union_members (const type2tc &t)
std::vector< irep_idt > struct_union_member_names (const type2tc &t)
irep_idt struct_union_name (const type2tc &t)
bool struct_union_packed (const type2tc &t)
std::vector< type2tc > & struct_union_members (type2tc &t)
 Mutating reference to a struct/union's members vector.
std::optional< unsigned int > struct_union_get_component_number (const type2tc &t, const irep_idt &comp)
 Index of comp in struct/union/complex member_names, or nullopt if it is missing or duplicated (the latter is malformed IR).

Macro Definition Documentation

◆ IREP2_TYPE [1/2]

#define IREP2_TYPE ( kind,
pretty )
Value:
#define type_macros(name)
Definition irep2_type.h:700

◆ IREP2_TYPE [2/2]

#define IREP2_TYPE ( kind,
pretty )
Value:
class kind##_type2t;

◆ irep_typedefs

#define irep_typedefs ( basename)
Value:
template <typename... Args> \
inline type2tc basename##_type2tc(Args &&...args) \
{ \
return make_irep<basename##_type2t>(std::forward<Args>(args)...); \
}
irep_container< typename T::base_type > make_irep(Args &&...args)
Allocate a fresh irep2 node and adopt it into an irep_container.
Definition irep2.h:451
irep_container< type2t > type2tc
Definition irep2.h:430

◆ type_macros

#define type_macros ( name)
Value:
inline bool is_##name##_type(const expr2tc &e) \
{ \
return e->type->type_id == type2t::name##_id; \
} \
inline bool is_##name##_type(const type2tc &t) \
{ \
return t->type_id == type2t::name##_id; \
} \
inline const name##_type2t &to_##name##_type(const type2tc &t) \
{ \
*t.get(), type2t::name##_id, #name); \
} \
inline name##_type2t &to_##name##_type(type2tc &t) \
{ \
*t.get(), type2t::name##_id, #name); \
} \
inline const name##_type2t *try_to_##name##_type(const type2tc &t) \
{ \
return is_##name##_type(t) ? &to_##name##_type(t) : nullptr; \
}
Derived & irep2_checked_type_cast(type2t &t, type2t::type_ids expected, const char *target_name)
Definition irep2.h:1202
irep_container< expr2t > expr2tc
Definition irep2.h:431
name
Definition transform.py:21

Enumeration Type Documentation

◆ pointer_ref_kindt

enum class pointer_ref_kindt
strong

How the source spelled a pointer.

The irept form keeps this in the #reference / #rvalue_reference attributes, which have no equivalent here, so a round trip used to erase it.

Enumerator
NONE 
LVALUE 
RVALUE 

Function Documentation

◆ irep_typedefs() [1/15]

irep_typedefs ( array )

◆ irep_typedefs() [2/15]

irep_typedefs ( bool )

◆ irep_typedefs() [3/15]

irep_typedefs ( code )

◆ irep_typedefs() [4/15]

irep_typedefs ( complex )

◆ irep_typedefs() [5/15]

irep_typedefs ( cpp_name )

◆ irep_typedefs() [6/15]

irep_typedefs ( empty )

◆ irep_typedefs() [7/15]

irep_typedefs ( fixedbv )

◆ irep_typedefs() [8/15]

irep_typedefs ( floatbv )

◆ irep_typedefs() [9/15]

irep_typedefs ( pointer )

◆ irep_typedefs() [10/15]

irep_typedefs ( signedbv )

◆ irep_typedefs() [11/15]

irep_typedefs ( struct )

◆ irep_typedefs() [12/15]

irep_typedefs ( symbol )

◆ irep_typedefs() [13/15]

irep_typedefs ( union )

◆ irep_typedefs() [14/15]

irep_typedefs ( unsignedbv )

◆ irep_typedefs() [15/15]

irep_typedefs ( vector )

◆ struct_union_get_component_number()

std::optional< unsigned int > struct_union_get_component_number ( const type2tc & t,
const irep_idt & comp )

Index of comp in struct/union/complex member_names, or nullopt if it is missing or duplicated (the latter is malformed IR).

◆ struct_union_member_names()

std::vector< irep_idt > struct_union_member_names ( const type2tc & t)

◆ struct_union_members() [1/2]

std::vector< type2tc > struct_union_members ( const type2tc & t)

◆ struct_union_members() [2/2]

std::vector< type2tc > & struct_union_members ( type2tc & t)

Mutating reference to a struct/union's members vector.

Unlike the read-only overload this does NOT synthesise a view for complex_type (which has no members vector), so it is restricted to struct_id and union_id; passing anything else aborts. Detaches t first via the non-const to_*_type accessor, so the returned reference is safe to mutate.

◆ struct_union_name()

irep_idt struct_union_name ( const type2tc & t)

◆ struct_union_packed()

bool struct_union_packed ( const type2tc & t)