ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
type_byte_size.cpp File Reference
#include <algorithm>
#include <cstdlib>
#include <irep2/irep2_utils.h>
#include <irep2/irep2_type.h>
#include <util/arith/arith_tools.h>
#include <util/config/config.h>
#include <util/lang/c_types.h>
#include <util/irep/expr.h>
#include <util/message/message.h>
#include <util/message/format.h>
#include <util/irep/migrate.h>
#include <util/irep/std_types.h>
#include <util/expr/type_byte_size.h>
Include dependency graph for type_byte_size.cpp:

Functions

BigInt member_offset_bits (const type2tc &type, const irep_idt &member, const namespacet *ns)
BigInt member_offset (const type2tc &type, const irep_idt &member, const namespacet *ns)
std::vector< std::string > member_paths_at_offset (const type2tc &type, const BigInt &offset, const type2tc &target, const namespacet &ns)
std::vector< std::string > member_paths_of_type (const type2tc &type, const type2tc &target, const namespacet &ns)
BigInt type_byte_size_default (const type2tc &type, const BigInt &defaultval, const namespacet *ns)
BigInt type_byte_size_bits (const type2tc &type, const namespacet *ns)
BigInt type_byte_size (const type2tc &type, const namespacet *ns)
static expr2tc bitsize (BigInt n)
expr2tc type_byte_size_bits_expr (const type2tc &type, const namespacet *ns)
expr2tc type_byte_size_expr (const type2tc &type, const namespacet *ns)
expr2tc compute_pointer_offset_bits (const expr2tc &expr, const namespacet *ns)
expr2tc compute_pointer_offset (const expr2tc &expr, const namespacet *ns)
const expr2tc & get_base_object (const expr2tc &expr)
std::size_t ext_int_representation_bytes (const typet &type)
static bool aligns_as_subtype (const typet &type)
 An array, or a _Complex T, which is laid out as T[2] (C17 6.2.5p13).
static BigInt abi_scalar_alignment (const typet &type, const BigInt &natural)
 An 8-byte or wider scalar takes the target's ABI alignment when the C frontend recorded one, which may be below its size (i386, #8694).
static BigInt bitint_alignment (const typet &type)
 A _BitInt aligns like the smallest integer holding it, capped by the target (#8692).
BigInt access_alignment (const BigInt &bytes)
BigInt alignment (const typet &type, const namespacet &ns)
static bool declines_alignment (const typet &type, const namespacet &ns)
static BigInt base_alignment_bump (const expr2tc &size)
bool is_power_of_two (const BigInt &v)
BigInt object_base_alignment (const typet &type, const expr2tc &size, const namespacet &ns)

Function Documentation

◆ abi_scalar_alignment()

BigInt abi_scalar_alignment ( const typet & type,
const BigInt & natural )
static

An 8-byte or wider scalar takes the target's ABI alignment when the C frontend recorded one, which may be below its size (i386, #8694).

◆ access_alignment()

BigInt access_alignment ( const BigInt & bytes)

◆ alignment()

BigInt alignment ( const typet & type,
const namespacet & ns )

◆ aligns_as_subtype()

bool aligns_as_subtype ( const typet & type)
static

An array, or a _Complex T, which is laid out as T[2] (C17 6.2.5p13).

◆ base_alignment_bump()

BigInt base_alignment_bump ( const expr2tc & size)
static

◆ bitint_alignment()

BigInt bitint_alignment ( const typet & type)
static

A _BitInt aligns like the smallest integer holding it, capped by the target (#8692).

◆ bitsize()

expr2tc bitsize ( BigInt n)
static

◆ compute_pointer_offset()

expr2tc compute_pointer_offset ( const expr2tc & expr,
const namespacet * ns )

◆ compute_pointer_offset_bits()

expr2tc compute_pointer_offset_bits ( const expr2tc & expr,
const namespacet * ns )

◆ declines_alignment()

bool declines_alignment ( const typet & type,
const namespacet & ns )
static

◆ ext_int_representation_bytes()

std::size_t ext_int_representation_bytes ( const typet & type)

◆ get_base_object()

const expr2tc & get_base_object ( const expr2tc & expr)

◆ is_power_of_two()

bool is_power_of_two ( const BigInt & v)

◆ member_offset()

BigInt member_offset ( const type2tc & type,
const irep_idt & member,
const namespacet * ns )

◆ member_offset_bits()

BigInt member_offset_bits ( const type2tc & type,
const irep_idt & member,
const namespacet * ns )

◆ member_paths_at_offset()

std::vector< std::string > member_paths_at_offset ( const type2tc & type,
const BigInt & offset,
const type2tc & target,
const namespacet & ns )

◆ member_paths_of_type()

std::vector< std::string > member_paths_of_type ( const type2tc & type,
const type2tc & target,
const namespacet & ns )

◆ object_base_alignment()

BigInt object_base_alignment ( const typet & type,
const expr2tc & size,
const namespacet & ns )

◆ type_byte_size()

BigInt type_byte_size ( const type2tc & type,
const namespacet * ns )

◆ type_byte_size_bits()

BigInt type_byte_size_bits ( const type2tc & type,
const namespacet * ns )

◆ type_byte_size_bits_expr()

expr2tc type_byte_size_bits_expr ( const type2tc & type,
const namespacet * ns )

◆ type_byte_size_default()

BigInt type_byte_size_default ( const type2tc & type,
const BigInt & defaultval,
const namespacet * ns )

◆ type_byte_size_expr()

expr2tc type_byte_size_expr ( const type2tc & type,
const namespacet * ns )