From 2efc957fbdc7d09f0ee89df6b5a7032ded29cc00 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 7 Sep 2016 10:37:36 +0800 Subject: MIR Gen - Hacky shallow drop support (doesn't support being conditional) --- src/mir/from_hir.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mir/from_hir.hpp') 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 m_arg_states; ::std::vector m_variable_states; ::std::vector 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 { -- cgit v1.2.3