aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-item.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2020-12-12 12:56:02 +0000
committerPhilip Herron <herron.philip@googlemail.com>2020-12-17 17:23:46 +0000
commit44d10d9547612b5fda3d27bb628d5d6ee79108af (patch)
treeee39563bec035ad3882c1e655a49ba55df12d47c /gcc/rust/resolve/rust-ast-resolve-item.h
parent4fb0ab7e635c65318aadf958e0e1303f3435c4e5 (diff)
downloadgcc-44d10d9547612b5fda3d27bb628d5d6ee79108af.zip
gcc-44d10d9547612b5fda3d27bb628d5d6ee79108af.tar.gz
gcc-44d10d9547612b5fda3d27bb628d5d6ee79108af.tar.bz2
TypeResolution pass now with a TyTy module
Resolution must implement the Gathering specified in the rust-dev guide. We need to be able to handle cases such as: let mut x; x = 1; or let mut x = vec!{} x.push(1) Now the TyTy module has a combine abstract method to allow the combination of types to condense down from their integral parts.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-item.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-item.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h
index ea79fc0..2c21a52 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.h
+++ b/gcc/rust/resolve/rust-ast-resolve-item.h
@@ -23,6 +23,7 @@
#include "rust-ast-full.h"
#include "rust-ast-resolve-type.h"
#include "rust-ast-resolve-pattern.h"
+#include "rust-ast-resolve-stmt.h"
namespace Rust {
namespace Resolver {
@@ -51,11 +52,21 @@ public:
param.get_node_id ());
}
+ // setup parent scoping for names
+ NodeId scope_node_id = function.get_definition ()->get_node_id ();
+ resolver->get_name_scope ().push (scope_node_id);
+ resolver->get_type_scope ().push (scope_node_id);
+ resolver->push_new_name_rib (resolver->get_name_scope ().peek ());
+ resolver->push_new_type_rib (resolver->get_type_scope ().peek ());
+
function.get_definition ()->iterate_stmts (
[&] (AST::Stmt *s) mutable -> bool {
- // TODO
+ ResolveStmt::go (s, s->get_node_id ());
return true;
});
+
+ resolver->get_name_scope ().pop ();
+ resolver->get_type_scope ().pop ();
}
private: