diff options
author | John Hodge (bugs) <tpg@mutabah.net> | 2017-07-06 17:41:10 +0800 |
---|---|---|
committer | John Hodge (bugs) <tpg@mutabah.net> | 2017-07-06 17:41:10 +0800 |
commit | 48e2c4973d5401c9f7d0ee2bac22ac6015744961 (patch) | |
tree | b93fb21b85343633e2d0c00c42ea7a388bb6f883 /src/mir/helpers.hpp | |
parent | ce3d36a90b9efd11c94f9084b5e727d65b6509a7 (diff) | |
parent | c4e88b3c49736e71534c918a83956885c052beb8 (diff) | |
download | mrust-48e2c4973d5401c9f7d0ee2bac22ac6015744961.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
# Conflicts:
# src/trans/codegen_c.cpp
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 ); } }; |