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.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/hir/serialise.cpp b/src/hir/serialise.cpp
index fc157704..75375265 100644
--- a/src/hir/serialise.cpp
+++ b/src/hir/serialise.cpp
@@ -469,6 +469,31 @@ namespace {
write_string(tmp.str());
}
+ void serialise(const ::HIR::Literal& lit)
+ {
+ write_tag(lit.tag());
+ TU_MATCHA( (lit), (e),
+ (Invalid,
+ BUG(Span(), "Literal::Invalid in HIR");
+ ),
+ (List,
+ serialise_vec(e);
+ ),
+ (Integer,
+ write_u64(e);
+ ),
+ (Float,
+ write_double(e);
+ ),
+ (BorrowOf,
+ serialise_simplepath(e);
+ ),
+ (String,
+ write_string(e);
+ )
+ )
+ }
+
void serialise(const ::HIR::ExprPtr& exp)
{
if( exp.m_mir ) {
@@ -766,7 +791,8 @@ namespace {
(Unit,
),
(Value,
- // TODO: Should be fully known now
+ // NOTE: e.expr skipped as it's not needed anymore
+ serialise(e.val);
),
(Tuple,
serialise_vec(e);