diff options
Diffstat (limited to 'src/mir/helpers.hpp')
-rw-r--r-- | src/mir/helpers.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mir/helpers.hpp b/src/mir/helpers.hpp index 802ce88f..f241753e 100644 --- a/src/mir/helpers.hpp +++ b/src/mir/helpers.hpp @@ -104,6 +104,7 @@ public: ::HIR::TypeRef get_const_type(const ::MIR::Constant& c) const; + bool lvalue_is_copy(const ::MIR::LValue& val) const; const ::HIR::TypeRef* is_type_owned_box(const ::HIR::TypeRef& ty) const; friend ::std::ostream& operator<<(::std::ostream& os, const TypeResolve& x) { @@ -158,14 +159,10 @@ public: struct ValueLifetimes { ::std::vector<size_t> m_block_offsets; - ::std::vector<ValueLifetime> m_temporaries; - ::std::vector<ValueLifetime> m_variables; + ::std::vector<ValueLifetime> m_slots; - bool var_valid(unsigned var_idx, unsigned bb_idx, unsigned stmt_idx) const { - return m_variables.at(var_idx).valid_at( m_block_offsets[bb_idx] + stmt_idx ); - } - bool tmp_valid(unsigned tmp_idx, unsigned bb_idx, unsigned stmt_idx) const { - return m_temporaries.at(tmp_idx).valid_at( m_block_offsets[bb_idx] + stmt_idx ); + bool slot_valid(unsigned idx, unsigned bb_idx, unsigned stmt_idx) const { + return m_slots.at(idx).valid_at( m_block_offsets[bb_idx] + stmt_idx ); } }; |