ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
irep2_type.cpp File Reference
#include <cstdint>
#include <limits>
#include <memory>
#include <util/arith/fixedbv.h>
#include <util/base/i2string.h>
#include <util/arith/ieee_float.h>
#include <irep2/irep2_type.h>
#include <irep2/irep2_expr.h>
#include <irep2/irep2_utils.h>
#include <irep2/irep2_dispatch.h>
#include <util/message/message.h>
#include <util/message/format.h>
#include <util/irep/migrate.h>
#include <irep2/type_kinds.inc>
Include dependency graph for irep2_type.cpp:

Macros

#define IREP2_TYPE(kind, pretty)
#define IREP2_TYPE(kind, _)
#define IREP2_TYPE(kind, _)
#define IREP2_TYPE(kind, _)
#define IREP2_TYPE(kind, _)
#define IREP2_TYPE(kind, _)
#define IREP2_TYPE(kind, _)
#define IREP2_TYPE(kind, _)

Functions

std::string get_type_id (const type2t &type)
 Fetch identifying name for a type.
void irep2_bad_type_cast (unsigned actual, unsigned expected, const char *target)
void irep2_bad_family_cast (unsigned actual, const char *accessor)
std::vector< type2tc > struct_union_members (const type2tc &t)
std::vector< type2tc > & struct_union_members (type2tc &t)
 Mutating reference to a struct/union's members vector.
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::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).

Variables

static const char * type_names []

Macro Definition Documentation

◆ IREP2_TYPE [1/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
return static_cast<const kind##_type2t &>(*this).get_width();

◆ IREP2_TYPE [2/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
esbmct::generic_foreach_subtype(static_cast<kind##_type2t &>(*this), f); \
return;

◆ IREP2_TYPE [3/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
esbmct::generic_foreach_subtype_const( \
static_cast<const kind##_type2t &>(*this), f); \
return;

◆ IREP2_TYPE [4/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
static_cast<const kind##_type2t &>(*this), indent);
list_of_memberst generic_tostring_type(const K &a, unsigned int indent)
Definition irep2_dispatch.h:356

◆ IREP2_TYPE [5/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
return make_irep<kind##_type2t>(static_cast<const kind##_type2t &>(*this));
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

◆ IREP2_TYPE [6/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
static_cast<const kind##_type2t &>(*this), o);
int generic_lt_type(const K &a, const type2t &o)
Definition irep2_dispatch.h:343

◆ IREP2_TYPE [7/8]

#define IREP2_TYPE ( kind,
_ )
Value:
case kind##_id: \
static_cast<const kind##_type2t &>(*this), o);
bool generic_cmp_type(const K &a, const type2t &o)
Definition irep2_dispatch.h:329

◆ IREP2_TYPE [8/8]

#define IREP2_TYPE ( kind,
pretty )
Value:
pretty,

Function Documentation

◆ get_type_id()

std::string get_type_id ( const type2t & type)

Fetch identifying name for a type.

Parameters
typeType to fetch identifier for
Returns
String containing name of type class.

◆ irep2_bad_family_cast()

void irep2_bad_family_cast ( unsigned actual,
const char * accessor )

◆ irep2_bad_type_cast()

void irep2_bad_type_cast ( unsigned actual,
unsigned expected,
const char * target )

◆ 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)

Variable Documentation

◆ type_names

const char* type_names[]
static