diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-08-22 13:04:33 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-08-22 13:04:33 +0200 |
commit | d3b3dd8e88383054f74a8301616770c76166a113 (patch) | |
tree | f6da9d2e18ce48e69f7e30b5cc9addc9497cad04 /kernel | |
parent | bce0bb6e43dbf36d451759f279b6968aada5bec8 (diff) | |
download | yosys-d3b3dd8e88383054f74a8301616770c76166a113.tar.gz yosys-d3b3dd8e88383054f74a8301616770c76166a113.tar.bz2 yosys-d3b3dd8e88383054f74a8301616770c76166a113.zip |
Add hashlib support for hashing of pools
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/hashlib.h | 7 |
1 files changed, 7 insertions, 0 deletions
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(); } |