diff options
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) + { + } +}; + +} |