diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-10-06 18:14:13 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-10-06 18:14:13 +0800 |
commit | 1382500b5fdba00568a86f0122bc2e78584dfb5d (patch) | |
tree | fc293328eea89d6639c4a36f268f5a1e1c826d6e /src/hir/expr_state.hpp | |
parent | 4a8198baca2cfcee17f83978ab71422a04d53b1a (diff) | |
parent | bd3d69813cc54439fdc0db33943fa1254db3df06 (diff) | |
download | mrust-1382500b5fdba00568a86f0122bc2e78584dfb5d.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/hir/expr_state.hpp')
-rw-r--r-- | src/hir/expr_state.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/hir/expr_state.hpp b/src/hir/expr_state.hpp new file mode 100644 index 00000000..5491b4d3 --- /dev/null +++ b/src/hir/expr_state.hpp @@ -0,0 +1,42 @@ +/* + * MRustC - Rust Compiler + * - By John Hodge (Mutabah/thePowersGang) + * + * hir/expr_state.hpp + * - Extra state for expression pointers + */ +#pragma once +#include <hir/hir.hpp> + +namespace HIR { + +struct ExprState +{ + ::HIR::SimplePath m_mod_path; + const ::HIR::Module& m_module; + + ::HIR::GenericParams* m_impl_generics; + ::HIR::GenericParams* m_item_generics; + + ::std::vector< ::std::pair< const ::HIR::SimplePath*, const ::HIR::Trait* > > m_traits; + + enum class Stage { + Created, + TypecheckRequest, + Typecheck, + MirRequest, + Mir, + }; + mutable Stage stage; + + ExprState(const ::HIR::Module& mod_ptr, ::HIR::SimplePath mod_path): + m_mod_path(::std::move(mod_path)), + m_module(mod_ptr), + m_impl_generics(nullptr), + m_item_generics(nullptr), + stage(Stage::Created) + { + } +}; + +} |