diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-05 10:52:33 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-05 10:52:33 +0800 |
commit | 6072655369db89d8c8ec0f79ef03f04f695f7459 (patch) | |
tree | d69db4dcfba3cca0064d689645e1dad06fe65063 /src/mir/from_hir.hpp | |
parent | d45ed7dacfb36edc80127ff90b1bdc0ca2279a2a (diff) | |
download | mrust-6072655369db89d8c8ec0f79ef03f04f695f7459.tar.gz |
MIR Gen - Drop InnerMoved early for cleaner logic
Diffstat (limited to 'src/mir/from_hir.hpp')
-rw-r--r-- | src/mir/from_hir.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mir/from_hir.hpp b/src/mir/from_hir.hpp index 66877913..e7492df6 100644 --- a/src/mir/from_hir.hpp +++ b/src/mir/from_hir.hpp @@ -38,14 +38,17 @@ public: ~ScopeHandle(); }; +// TODO: Replace the first three states with just one (and flags for init/moved) enum class VarState { Uninit, // No value assigned yet - Init, // Initialised and valid at this point - MaybeMoved, // Possibly has been moved - //MaybeMovedInner, // Inner possibly has been moved Moved, // Definitely moved - InnerMoved, // The inner has been moved, but the container needs to be dropped Dropped, // Dropped (out of scope) + + InnerMoved, // The inner has been moved, but the container needs to be dropped + //MaybeMovedInner, // Inner possibly has been moved + MaybeMoved, // Possibly has been moved + + Init, // Initialised and valid at this point }; extern ::std::ostream& operator<<(::std::ostream& os, VarState x); @@ -88,6 +91,7 @@ class MirBuilder ::MIR::RValue m_result; bool m_result_valid; + // TODO: Extra information. //::std::vector<VarState> m_arg_states; ::std::vector<VarState> m_variable_states; ::std::vector<VarState> m_temporary_states; |