summaryrefslogtreecommitdiff
path: root/src/hir/serialise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hir/serialise.cpp')
-rw-r--r--src/hir/serialise.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/hir/serialise.cpp b/src/hir/serialise.cpp
index 33f8123f..35acaa93 100644
--- a/src/hir/serialise.cpp
+++ b/src/hir/serialise.cpp
@@ -40,6 +40,16 @@ namespace {
serialise(v.second);
}
}
+ template<typename V>
+ void serialise_strmap(const ::std::unordered_multimap< ::std::string,V>& map)
+ {
+ m_out.write_count(map.size());
+ for(const auto& v : map) {
+ DEBUG("- " << v.first);
+ m_out.write_string(v.first);
+ serialise(v.second);
+ }
+ }
template<typename T>
void serialise_vec(const ::std::vector<T>& vec)
{
@@ -62,6 +72,11 @@ namespace {
m_out.write_string(e.first);
serialise(e.second);
}
+ template<typename T>
+ void serialise(const ::std::pair<unsigned int, T>& e) {
+ m_out.write_count(e.first);
+ serialise(e.second);
+ }
void serialise_type(const ::HIR::TypeRef& ty)
{
@@ -150,6 +165,7 @@ namespace {
serialise_simplepath(path.m_path);
serialise_pathparams(path.m_params);
}
+ void serialise(const ::HIR::GenericPath& path) { serialise_genericpath(path); }
void serialise_traitpath(const ::HIR::TraitPath& path)
{
serialise_genericpath(path.m_path);