diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-14 17:41:29 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-14 17:41:29 +0800 |
commit | ee8f1c7315b135b0b6d3393222aa8f9d47da3ec0 (patch) | |
tree | 1fce09a77ac014c1a2c3521f0d4971cff4db6ab7 /src/hir/expr.hpp | |
parent | 31b18e35522708cac4345f1817c07f9784d175df (diff) | |
download | mrust-ee8f1c7315b135b0b6d3393222aa8f9d47da3ec0.tar.gz |
HIR Expand - Add annotation pass
Diffstat (limited to 'src/hir/expr.hpp')
-rw-r--r-- | src/hir/expr.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hir/expr.hpp b/src/hir/expr.hpp index 203f878e..137377d7 100644 --- a/src/hir/expr.hpp +++ b/src/hir/expr.hpp @@ -11,6 +11,18 @@ namespace HIR { typedef ::std::vector< ::std::pair<const ::HIR::SimplePath*,const ::HIR::Trait*> > t_trait_list; +// Indicates how a result is used +enum class ValueUsage { + // Not yet known (defalt state) + Unknown, + // Value is borrowed (shared) + Borrow, + // Value is mutated or uniquely borrowed + Mutate, + // Value is moved + Move, +}; + class GenericParams; class ExprVisitor; @@ -20,6 +32,7 @@ class ExprNode public: Span m_span; ::HIR::TypeRef m_res_type; + ValueUsage m_usage = ValueUsage::Unknown; const Span& span() const { return m_span; } |