aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-01-15 13:41:01 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-08-01 16:52:26 +0200
commitf9ad1c29376e06950c3065f574f2df96b3265416 (patch)
tree461c68e8784bcc5a570bf1ad218a47effc3fcbdc /gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
parentd284cf6fe2006df512b4e63f5db554ef39e9f3ab (diff)
downloadgcc-f9ad1c29376e06950c3065f574f2df96b3265416.zip
gcc-f9ad1c29376e06950c3065f574f2df96b3265416.tar.gz
gcc-f9ad1c29376e06950c3065f574f2df96b3265416.tar.bz2
gccrs: Add call to globbing visitor
Globbing visitor did not visit subitems. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add a check for missing item. * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::go): Add a new function in the visitor to dispatch the visitor to items in the given module. (TopLevel::handle_use_glob): Change call to visitor to use the pointer. * resolve/rust-toplevel-name-resolver-2.0.h: Add prototype for new member function. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc')
-rw-r--r--gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 3122d41..5012041 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -26,6 +26,13 @@ namespace Rust {
namespace Resolver2_0 {
void
+GlobbingVisitor::go (AST::Module *module)
+{
+ for (auto &i : module->get_items ())
+ visit (i);
+}
+
+void
GlobbingVisitor::visit (AST::Module &module)
{
if (module.get_visibility ().is_public ())
@@ -399,7 +406,7 @@ TopLevel::handle_use_glob (AST::SimplePath glob)
return false;
GlobbingVisitor gvisitor (ctx);
- gvisitor.visit (*result.value ());
+ gvisitor.go (result.value ());
return true;
}