summaryrefslogtreecommitdiff
path: root/src/hir/expr_state.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-10-06 18:14:13 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-10-06 18:14:13 +0800
commit1382500b5fdba00568a86f0122bc2e78584dfb5d (patch)
treefc293328eea89d6639c4a36f268f5a1e1c826d6e /src/hir/expr_state.hpp
parent4a8198baca2cfcee17f83978ab71422a04d53b1a (diff)
parentbd3d69813cc54439fdc0db33943fa1254db3df06 (diff)
downloadmrust-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.hpp42
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)
+ {
+ }
+};
+
+}