summaryrefslogtreecommitdiff
path: root/kernel/rtlil.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-29 02:01:42 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-29 02:01:42 +0100
commitcfe0817697c9e7a656fd3a64e3a9014fa86e78d0 (patch)
treed9badfe3826ee6b68114639d5060dc4e82ae5235 /kernel/rtlil.h
parent9ff3a9f30da0cade42db433f94a408f4d9349ba2 (diff)
Converting "share" to dict<> and pool<> complete
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r--kernel/rtlil.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 5bca060f..25477d02 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -219,8 +219,8 @@ namespace RTLIL
return index_;
}
- // The following is a helper key_compare class. Instead of for example pool<Cell*>
- // use pool<Cell*, IdString::compare_ptr_by_name<Cell>> if the order of cells in the
+ // The following is a helper key_compare class. Instead of for example std::set<Cell*>
+ // use std::set<Cell*, IdString::compare_ptr_by_name<Cell>> if the order of cells in the
// set has an influence on the algorithm.
template<typename T> struct compare_ptr_by_name {
@@ -450,6 +450,13 @@ struct RTLIL::Const
std::string decode_string() const;
inline int size() const { return bits.size(); }
+
+ inline unsigned int hash() const {
+ unsigned int h = 5381;
+ for (auto b : bits)
+ mkhash(h, b);
+ return h;
+ }
};
struct RTLIL::SigChunk