aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/resolve')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-item.h6
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-toplevel.h9
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h
index 2c21a52..eca52dc 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.h
+++ b/gcc/rust/resolve/rust-ast-resolve-item.h
@@ -39,6 +39,12 @@ public:
~ResolveItem () {}
+ void visit (AST::ConstantItem &constant)
+ {
+ ResolveType::go (constant.get_type ().get (), constant.get_node_id ());
+ ResolveExpr::go (constant.get_expr ().get (), constant.get_node_id ());
+ }
+
void visit (AST::Function &function)
{
if (function.has_return_type ())
diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h
index fcc9663..0b6256e 100644
--- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h
+++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h
@@ -36,6 +36,15 @@ public:
~ResolveTopLevel () {}
+ void visit (AST::ConstantItem &constant)
+ {
+ resolver->get_name_scope ().insert (constant.get_identifier (),
+ constant.get_node_id ());
+ resolver->insert_new_definition (constant.get_node_id (),
+ Definition{constant.get_node_id (),
+ constant.get_node_id ()});
+ }
+
void visit (AST::Function &function)
{
// function_names are simple std::String identifiers so this can be a