aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-name-resolver.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-name-resolver.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-name-resolver.h')
-rw-r--r--gcc/rust/resolve/rust-name-resolver.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-name-resolver.h b/gcc/rust/resolve/rust-name-resolver.h
index 4aac7d5..2aa592c 100644
--- a/gcc/rust/resolve/rust-name-resolver.h
+++ b/gcc/rust/resolve/rust-name-resolver.h
@@ -21,6 +21,7 @@
#include "rust-system.h"
#include "rust-hir-map.h"
+#include "rust-hir-type-check.h"
namespace Rust {
namespace Resolver {
@@ -55,6 +56,15 @@ public:
CrateNum get_crate_num () const { return crate_num; }
NodeId get_node_id () const { return node_id; }
+ void iterate_decls (std::function<bool (NodeId)> cb)
+ {
+ for (auto it : decls_within_rib)
+ {
+ if (!cb (it))
+ return;
+ }
+ }
+
private:
CrateNum crate_num;
NodeId node_id;
@@ -174,6 +184,7 @@ private:
void generate_builtins ();
Analysis::Mappings *mappings;
+ TypeCheckContext *tyctx;
std::vector<AST::TypePath *> builtins;