From: Clifford Wolf Date: Tue, 22 Aug 2017 11:04:33 +0000 (+0200) Subject: Add hashlib support for hashing of pools X-Git-Tag: yosys-0.8~337 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3b3dd8e88383054f74a8301616770c76166a113;p=yosys.git Add hashlib support for hashing of pools --- diff --git a/kernel/hashlib.h b/kernel/hashlib.h index 63ac956f2..df534ec1b 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -868,6 +868,13 @@ public: return !operator==(other); } + bool hash() const { + unsigned int hashval = mkhash_init; + for (auto &it : entries) + hashval ^= ops.hash(it.udata); + return hashval; + } + void reserve(size_t n) { entries.reserve(n); } size_t size() const { return entries.size(); } bool empty() const { return entries.empty(); }