public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7887] gccrs: nr2.0: Visit receiver/call expression and arguments in calls/methods
@ 2024-01-16 18:04 Arthur Cohen
0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:04 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2bde73fa4669dfb34a981aa91b750e5ca8433491
commit r14-7887-g2bde73fa4669dfb34a981aa91b750e5ca8433491
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Wed Aug 2 11:22:10 2023 +0200
gccrs: nr2.0: Visit receiver/call expression and arguments in calls/methods
gcc/rust/ChangeLog:
* resolve/rust-default-resolver.cc
(DefaultResolver::visit): Visit CallExpr and MethodCallExpr properly.
* resolve/rust-default-resolver.h: Switch "node" to plural in documentation.
Diff:
---
gcc/rust/resolve/rust-default-resolver.cc | 16 +++++++++++++---
gcc/rust/resolve/rust-default-resolver.h | 2 +-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 5cf4fe79ea1..1d54f91e644 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -303,15 +303,25 @@ DefaultResolver::visit (AST::StructExprFieldIndexValue &)
void
DefaultResolver::visit (AST::CallExpr &expr)
-{}
+{
+ expr.get_function_expr ()->accept_vis (*this);
+ for (auto ¶m : expr.get_params ())
+ param->accept_vis (*this);
+}
void
DefaultResolver::visit (AST::MethodCallExpr &expr)
-{}
+{
+ expr.get_receiver_expr ()->accept_vis (*this);
+ for (auto ¶m : expr.get_params ())
+ param->accept_vis (*this);
+}
void
DefaultResolver::visit (AST::FieldAccessExpr &expr)
-{}
+{
+ expr.get_receiver_expr ()->accept_vis (*this);
+}
void
DefaultResolver::visit (AST::ClosureExprInner &)
diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h
index 17b87ef5435..03b4a5421a4 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -56,7 +56,7 @@ public:
void visit (AST::Union &);
void visit (AST::Enum &);
- // Visitors that visit their expression node
+ // Visitors that visit their expression node(s)
void visit (AST::BorrowExpr &);
void visit (AST::DereferenceExpr &);
void visit (AST::ErrorPropagationExpr &);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-16 18:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:04 [gcc r14-7887] gccrs: nr2.0: Visit receiver/call expression and arguments in calls/methods Arthur Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).