ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
clang_c_base_layout.cpp File Reference
Include dependency graph for clang_c_base_layout.cpp:

Functions

static std::optional< BigInt > member_delta (const namespacet &ns, const struct_typet &ds, const type2tc &d2, const type2tc &b2, const struct_typet::componentt &c, const irep_idt &base_id)
static bool base_subobject_offset (const namespacet &ns, const typet &derived, const irep_idt &base_id, BigInt &offset)
static bool uses_flattened_layout (const namespacet &ns, const typet &derived)
static bool flattened_base_offset (const namespacet &ns, const typet &derived, const irep_idt &base_id, BigInt &offset)
bool base_displacement (const namespacet &ns, const typet &derived, const irep_idt &base_id, BigInt &offset)
 Displacement of base_id's subobject inside derived, in bytes, under whichever layout ESBMC gave the class.

Function Documentation

◆ base_displacement()

bool base_displacement ( const namespacet & ns,
const typet & derived,
const irep_idt & base_id,
BigInt & offset )

Displacement of base_id's subobject inside derived, in bytes, under whichever layout ESBMC gave the class.

False when neither layout places the base at a single fixed displacement – a virtual base shared by two sibling bases has none.

The one oracle for this question. Shared rather than file-local because the IREP2 adjust pass needs the same answer, and taking the offset from anywhere else is the mistake scope-clang-c-irep2.md #3894 records (docs/roadmap/scope-clang-cpp-irep2.md \S3.12).

◆ base_subobject_offset()

bool base_subobject_offset ( const namespacet & ns,
const typet & derived,
const irep_idt & base_id,
BigInt & offset )
static

◆ flattened_base_offset()

bool flattened_base_offset ( const namespacet & ns,
const typet & derived,
const irep_idt & base_id,
BigInt & offset )
static

◆ member_delta()

std::optional< BigInt > member_delta ( const namespacet & ns,
const struct_typet & ds,
const type2tc & d2,
const type2tc & b2,
const struct_typet::componentt & c,
const irep_idt & base_id )
static

◆ uses_flattened_layout()

bool uses_flattened_layout ( const namespacet & ns,
const typet & derived )
static