diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-04-22 13:31:07 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-04-22 13:31:07 +0800 |
commit | 83b9e560df97f054dc2ea0660cda3fb55cd274d7 (patch) | |
tree | 057be3e50eee6278f00b260a581d08931aa6e929 /src/hir | |
parent | 6f5792ac00800b1a28b8c9c81eb80046f37b2f03 (diff) | |
download | mrust-83b9e560df97f054dc2ea0660cda3fb55cd274d7.tar.gz |
MIR - Add ScopeEnd statement to indicate where a value will no longer be used
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/deserialise.cpp | 5 | ||||
-rw-r--r-- | src/hir/serialise.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/hir/deserialise.cpp b/src/hir/deserialise.cpp index 4a9b5720..19306a63 100644 --- a/src/hir/deserialise.cpp +++ b/src/hir/deserialise.cpp @@ -1008,6 +1008,11 @@ namespace { m_in.read_bool(), static_cast<unsigned int>(m_in.read_count()) }); + case 4: + return ::MIR::Statement::make_ScopeEnd({ + deserialise_vec<unsigned int>(), + deserialise_vec<unsigned int>() + }); default: ::std::cerr << "Bad tag for a MIR Statement" << ::std::endl; throw ""; diff --git a/src/hir/serialise.cpp b/src/hir/serialise.cpp index 81319c2e..e5264ae2 100644 --- a/src/hir/serialise.cpp +++ b/src/hir/serialise.cpp @@ -495,6 +495,11 @@ namespace { m_out.write_count(e.idx); m_out.write_bool(e.new_val); m_out.write_count(e.other); + ), + (ScopeEnd, + m_out.write_tag(4); + serialise_vec(e.vars); + serialise_vec(e.tmps); ) ) } |