diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-24 11:20:37 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-24 11:20:37 +0800 |
commit | 62a2bde2e87b4ac0789848b5b9ec54e91de15238 (patch) | |
tree | 95280ec25497e0f2ce275cd348032b8d7d68478e /src/mir/from_hir.hpp | |
parent | f9763ded502656e173f4c4dc3189142e8254987e (diff) | |
download | mrust-62a2bde2e87b4ac0789848b5b9ec54e91de15238.tar.gz |
MIR Gen - Further span propagation
Diffstat (limited to 'src/mir/from_hir.hpp')
-rw-r--r-- | src/mir/from_hir.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mir/from_hir.hpp b/src/mir/from_hir.hpp index cef6e297..93100b44 100644 --- a/src/mir/from_hir.hpp +++ b/src/mir/from_hir.hpp @@ -75,6 +75,7 @@ class MirBuilder { friend class ScopeHandle; + const Span& m_root_span; const StaticTraitResolve& m_resolve; ::MIR::Function& m_output; @@ -108,7 +109,7 @@ class MirBuilder ::std::vector<unsigned int> m_scope_stack; ScopeHandle m_fcn_scope; public: - MirBuilder(const StaticTraitResolve& resolve, ::MIR::Function& output); + MirBuilder(const Span& sp, const StaticTraitResolve& resolve, ::MIR::Function& output); ~MirBuilder(); const ::HIR::Crate& crate() const { return m_resolve.m_crate; } @@ -163,10 +164,10 @@ public: // Helper - Marks a variable/... as moved (and checks if the move is valid) void moved_lvalue(const Span& sp, const ::MIR::LValue& lv); private: - VarState get_variable_state(unsigned int idx) const; - void set_variable_state(unsigned int idx, VarState state); - VarState get_temp_state(unsigned int idx) const; - void set_temp_state(unsigned int idx, VarState state); + VarState get_variable_state(const Span& sp, unsigned int idx) const; + void set_variable_state(const Span& sp, unsigned int idx, VarState state); + VarState get_temp_state(const Span& sp, unsigned int idx) const; + void set_temp_state(const Span& sp, unsigned int idx, VarState state); void drop_scope_values(const ScopeDef& sd); void complete_scope(ScopeDef& sd); |