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

Macros

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

Functions

void irep2_content_hash (const expr2tc &e, const irep2_name_mappert &rename, const irep2_symbol_mappert &rename_symbol, uint64_t &lo, uint64_t &hi)
 Structural hash of e that depends only on its content.

Macro Definition Documentation

◆ IREP2_EXPR

#define IREP2_EXPR ( kind,
_ )
Value:
case expr2t::kind##_id: \
all_fields(static_cast<const kind##2t &>(*e)); \
return;

◆ IREP2_TYPE

#define IREP2_TYPE ( kind,
_ )
Value:
case type2t::kind##_id: \
all_fields(static_cast<const kind##_type2t &>(*t)); \
return;

Function Documentation

◆ irep2_content_hash()

void irep2_content_hash ( const expr2tc & e,
const irep2_name_mappert & rename,
const irep2_symbol_mappert & rename_symbol,
uint64_t & lo,
uint64_t & hi )

Structural hash of e that depends only on its content.

Every irep_idt contributes its characters (through rename), so the result is stable across processes – unlike crc(), whose irep_idt hash is the string-pool index. Nothing is copied or rendered to text: the walk reads the expression in place and feeds the two rolling lanes, which chain across calls so a sequence of expressions accumulates into one 128-bit value.