ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
c_typecastt Class Reference

#include <c_typecast.h>

Public Member Functions

 c_typecastt (const namespacet &_ns)
virtual ~c_typecastt ()=default
virtual void implicit_typecast (exprt &expr, const typet &type)
virtual void implicit_typecast (expr2tc &expr, const type2tc &type)
virtual void implicit_typecast_arithmetic (exprt &expr)
virtual void implicit_typecast_arithmetic (expr2tc &expr)
virtual void implicit_typecast_arithmetic (exprt &expr1, exprt &expr2)
virtual void implicit_typecast_arithmetic (expr2tc &expr1, expr2tc &expr2)

Public Attributes

std::list< std::string > errors
std::list< std::string > warnings

Protected Types

enum  c_typet {
  BOOL , CHAR , UCHAR , INT ,
  UINT , LONG , ULONG , LONGLONG ,
  ULONGLONG , INT128 , UINT128 , SINGLE ,
  DOUBLE , LONGDOUBLE , VOIDPTR , PTR ,
  OTHER
}

Protected Member Functions

c_typet get_c_type (const typet &type)
c_typet get_c_type (const type2tc &type)
void implicit_typecast_arithmetic (exprt &expr, c_typet c_type)
void implicit_typecast_arithmetic (expr2tc &expr, c_typet c_type)
typet follow_with_qualifiers (const typet &src)
type2tc follow_with_qualifiers (const type2tc &src)
virtual void implicit_typecast_followed (exprt &expr, const typet &src_type, const typet &dest_type)
virtual void implicit_typecast_followed (expr2tc &expr, const type2tc &src_type, const type2tc &dest_type)
bool convert_reference (expr2tc &expr, const type2tc &src_type, const type2tc &dest_type)
 The two reference arms, split out to keep implicit_typecast_followed under the complexity gate.
bool convert_to_pointer (expr2tc &expr, const type2tc &src_type, const type2tc &dest_type)
void do_typecast (exprt &dest, const typet &type)
void do_typecast (expr2tc &dest, const type2tc &type)

Static Protected Member Functions

static c_typet rank_integer (unsigned width, bool is_signed)
static c_typet rank_floating (unsigned width)

Protected Attributes

const namespacet & ns
bool no_simplify

Member Enumeration Documentation

◆ c_typet

Enumerator
BOOL 
CHAR 
UCHAR 
INT 
UINT 
LONG 
ULONG 
LONGLONG 
ULONGLONG 
INT128 
UINT128 
SINGLE 
DOUBLE 
LONGDOUBLE 
VOIDPTR 
PTR 
OTHER 

Constructor & Destructor Documentation

◆ c_typecastt()

c_typecastt::c_typecastt ( const namespacet & _ns)
inline

◆ ~c_typecastt()

virtual c_typecastt::~c_typecastt ( )
virtualdefault

Member Function Documentation

◆ convert_reference()

bool c_typecastt::convert_reference ( expr2tc & expr,
const type2tc & src_type,
const type2tc & dest_type )
protected

The two reference arms, split out to keep implicit_typecast_followed under the complexity gate.

Returns true when one applied; the caller still falls through to the tail, as the irept copy does.

The subtype guard is type_id, coarser than the irept copy's id(): migrate_type maps c_enum and intcap onto signedbv, so an enum bound to a reference takes the address here where irept declines. A widening, never a narrowing – it cannot lose an address-of irept produces.

◆ convert_to_pointer()

bool c_typecastt::convert_to_pointer ( expr2tc & expr,
const type2tc & src_type,
const type2tc & dest_type )
protected

◆ do_typecast() [1/2]

void c_typecastt::do_typecast ( expr2tc & dest,
const type2tc & type )
protected

◆ do_typecast() [2/2]

void c_typecastt::do_typecast ( exprt & dest,
const typet & type )
protected

◆ follow_with_qualifiers() [1/2]

type2tc c_typecastt::follow_with_qualifiers ( const type2tc & src)
protected

◆ follow_with_qualifiers() [2/2]

typet c_typecastt::follow_with_qualifiers ( const typet & src)
protected

◆ get_c_type() [1/2]

c_typecastt::c_typet c_typecastt::get_c_type ( const type2tc & type)
protected

◆ get_c_type() [2/2]

c_typecastt::c_typet c_typecastt::get_c_type ( const typet & type)
protected

◆ implicit_typecast() [1/2]

void c_typecastt::implicit_typecast ( expr2tc & expr,
const type2tc & type )
virtual

◆ implicit_typecast() [2/2]

void c_typecastt::implicit_typecast ( exprt & expr,
const typet & type )
virtual

◆ implicit_typecast_arithmetic() [1/6]

void c_typecastt::implicit_typecast_arithmetic ( expr2tc & expr)
virtual

◆ implicit_typecast_arithmetic() [2/6]

void c_typecastt::implicit_typecast_arithmetic ( expr2tc & expr,
c_typet c_type )
protected

◆ implicit_typecast_arithmetic() [3/6]

void c_typecastt::implicit_typecast_arithmetic ( expr2tc & expr1,
expr2tc & expr2 )
virtual

◆ implicit_typecast_arithmetic() [4/6]

void c_typecastt::implicit_typecast_arithmetic ( exprt & expr)
virtual

◆ implicit_typecast_arithmetic() [5/6]

void c_typecastt::implicit_typecast_arithmetic ( exprt & expr,
c_typet c_type )
protected

◆ implicit_typecast_arithmetic() [6/6]

void c_typecastt::implicit_typecast_arithmetic ( exprt & expr1,
exprt & expr2 )
virtual

◆ implicit_typecast_followed() [1/2]

void c_typecastt::implicit_typecast_followed ( expr2tc & expr,
const type2tc & src_type,
const type2tc & dest_type )
protectedvirtual

◆ implicit_typecast_followed() [2/2]

void c_typecastt::implicit_typecast_followed ( exprt & expr,
const typet & src_type,
const typet & dest_type )
protectedvirtual

◆ rank_floating()

c_typecastt::c_typet c_typecastt::rank_floating ( unsigned width)
staticprotected

◆ rank_integer()

c_typecastt::c_typet c_typecastt::rank_integer ( unsigned width,
bool is_signed )
staticprotected

Member Data Documentation

◆ errors

std::list<std::string> c_typecastt::errors

◆ no_simplify

bool c_typecastt::no_simplify
protected

◆ ns

const namespacet& c_typecastt::ns
protected

◆ warnings

std::list<std::string> c_typecastt::warnings

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