diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-07 18:03:36 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-07 18:03:36 +0800 |
commit | 058a5dab9d2a61514265bd6718ec83f8d3721de6 (patch) | |
tree | 89bf24e52682627facffd5eefb99377ea6a3786b /src/hir/serialise.cpp | |
parent | 7fc04390dee98081027e7ffc7510b100b929fdd0 (diff) | |
download | mrust-058a5dab9d2a61514265bd6718ec83f8d3721de6.tar.gz |
MIR - Merge two call types into one with a different target
Diffstat (limited to 'src/hir/serialise.cpp')
-rw-r--r-- | src/hir/serialise.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/hir/serialise.cpp b/src/hir/serialise.cpp index 35acaa93..65ccad6c 100644 --- a/src/hir/serialise.cpp +++ b/src/hir/serialise.cpp @@ -506,19 +506,27 @@ namespace { for(auto t : e.targets) m_out.write_count(t); ), - (CallValue, + (Call, m_out.write_count(e.ret_block); m_out.write_count(e.panic_block); serialise(e.ret_val); - serialise(e.fcn_val); + serialise(e.fcn); serialise_vec(e.args); + ) + ) + } + void serialise(const ::MIR::CallTarget& ct) + { + m_out.write_tag( static_cast<int>(ct.tag()) ); + TU_MATCHA( (ct), (e), + (Value, + serialise(e); ), - (CallPath, - m_out.write_count(e.ret_block); - m_out.write_count(e.panic_block); - serialise(e.ret_val); - serialise_path(e.fcn_path); - serialise_vec(e.args); + (Path, + serialise_path(e); + ), + (Intrinsic, + m_out.write_string(e); ) ) } |