aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/yosys.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/yosys.h')
-rw-r--r--kernel/yosys.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/yosys.h b/kernel/yosys.h
index 14277ade8..d4f46a519 100644
--- a/kernel/yosys.h
+++ b/kernel/yosys.h
@@ -147,8 +147,10 @@ struct shared_str {
shared_str() { }
shared_str(string s) { content = std::shared_ptr<string>(new string(s)); }
shared_str(const char *s) { content = std::shared_ptr<string>(new string(s)); }
- const char *c_str() { return content->c_str(); }
- const string &str() { return *content; }
+ const char *c_str() const { return content->c_str(); }
+ const string &str() const { return *content; }
+ bool operator==(const shared_str &other) const { return *content == *other.content; }
+ unsigned int hash() const { return hashlib::hash_ops<std::string>::hash(*content); }
};
using hashlib::mkhash;