summaryrefslogtreecommitdiff
path: root/src/mir/from_hir.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-09-07 10:37:36 +0800
committerJohn Hodge <tpg@mutabah.net>2016-09-07 10:37:36 +0800
commit2efc957fbdc7d09f0ee89df6b5a7032ded29cc00 (patch)
treeefaae647130d4068d5fc0f671a0d527bc29c5975 /src/mir/from_hir.hpp
parentd47803233fdc6a5576d5eb9f4495bce61f42ff7a (diff)
downloadmrust-2efc957fbdc7d09f0ee89df6b5a7032ded29cc00.tar.gz
MIR Gen - Hacky shallow drop support (doesn't support being conditional)
Diffstat (limited to 'src/mir/from_hir.hpp')
-rw-r--r--src/mir/from_hir.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mir/from_hir.hpp b/src/mir/from_hir.hpp
index 475087c7..c5d770af 100644
--- a/src/mir/from_hir.hpp
+++ b/src/mir/from_hir.hpp
@@ -42,7 +42,9 @@ 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)
};
extern ::std::ostream& operator<<(::std::ostream& os, VarState x);
@@ -86,6 +88,7 @@ class MirBuilder
::MIR::RValue m_result;
bool m_result_valid;
+ //::std::vector<VarState> m_arg_states;
::std::vector<VarState> m_variable_states;
::std::vector<VarState> m_temporary_states;
@@ -140,6 +143,8 @@ public:
void push_stmt_assign(const Span& sp, ::MIR::LValue dst, ::MIR::RValue val);
// Push a drop (likely only used by scope cleanup)
void push_stmt_drop(const Span& sp, ::MIR::LValue val);
+ // Push a shallow drop (for Box)
+ void push_stmt_drop_shallow(const Span& sp, ::MIR::LValue val);
// - Block management
bool block_active() const {