diff options
Diffstat (limited to 'src/mir/helpers.hpp')
-rw-r--r-- | src/mir/helpers.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mir/helpers.hpp b/src/mir/helpers.hpp index 3a37ed8e..8b4e8424 100644 --- a/src/mir/helpers.hpp +++ b/src/mir/helpers.hpp @@ -23,6 +23,10 @@ class Function; class LValue; class Constant; class BasicBlock; +class Terminator; +class Statement; +class RValue; +class Param; typedef unsigned int BasicBlockId; @@ -164,6 +168,21 @@ struct ValueLifetimes } }; +namespace visit { + enum class ValUsage { + Move, + Read, + Write, + Borrow, + }; + + extern bool visit_mir_lvalue(const ::MIR::LValue& lv, ValUsage u, ::std::function<bool(const ::MIR::LValue& , ValUsage)> cb); + extern bool visit_mir_lvalue(const ::MIR::Param& p, ValUsage u, ::std::function<bool(const ::MIR::LValue& , ValUsage)> cb); + extern bool visit_mir_lvalues(const ::MIR::RValue& rval, ::std::function<bool(const ::MIR::LValue& , ValUsage)> cb); + extern bool visit_mir_lvalues(const ::MIR::Statement& stmt, ::std::function<bool(const ::MIR::LValue& , ValUsage)> cb); + extern bool visit_mir_lvalues(const ::MIR::Terminator& term, ::std::function<bool(const ::MIR::LValue& , ValUsage)> cb); +} // namespace visit + } // namespace MIR extern ::MIR::ValueLifetimes MIR_Helper_GetLifetimes(::MIR::TypeResolve& state, const ::MIR::Function& fcn, bool dump_debug); |