Skip to content

Conversation

@kroening
Copy link
Collaborator

@kroening kroening commented Jan 12, 2026

This adds a next member to bv_varidt.

This enforces the use of the constructor of bv_varidt, instead of assigning
to the fields after default initialisation.
This adds a 'next' member to bv_varidt.
size_t operator()(const bv_varidt &bv_varid) const
{ return hash_string(bv_varid.id)^bv_varid.bit_nr; }
{
return hash_string(bv_varid.id) ^ bv_varid.bit_nr ^ bv_varid.next;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this perhaps use the hash function helpers from irep_hash.h instead of naively XOR-ing values? bit_nr will only ever have some of the least-significant bits set, and next will only ever be 0 or 1. Alas, only id will make use of all bits, while the other two will only ever affect a small subset of the bits. In contrast, hash_combine would take care of rotating and distributing bits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants