diff --git a/kernel/hashlib.h b/kernel/hashlib.h index 12349b21cfb..278832c008f 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -205,6 +205,18 @@ template struct hash_ops> { } }; +template struct hash_ops> { + static inline bool cmp(std::optional a, std::optional b) { + return a == b; + } + static inline unsigned int hash(std::optional a) { + if(a.has_value()) + return mkhash(*a); + else + return 0; + } +}; + inline int hashtable_size(int min_size) { static std::vector zero_and_some_primes = { diff --git a/kernel/yosys_common.h b/kernel/yosys_common.h index 4391ad582ee..86d448d211b 100644 --- a/kernel/yosys_common.h +++ b/kernel/yosys_common.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include