From: Owen Avery <[email protected]>
gcc/rust/ChangeLog:
* resolve/rust-default-resolver.cc
(DefaultResolver::visit):
New for AST::CallExpr and AST::MethodCallExpr.
* resolve/rust-default-resolver.h
(DefaultResolver::visit): Likewise.
Signed-off-by: Owen Avery <[email protected]>
---
gcc/rust/resolve/rust-default-resolver.cc | 30 +++++++++++++++++++++++
gcc/rust/resolve/rust-default-resolver.h | 2 ++
2 files changed, 32 insertions(+)
diff --git a/gcc/rust/resolve/rust-default-resolver.cc
b/gcc/rust/resolve/rust-default-resolver.cc
index 50625bab956..757acfe8595 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -236,6 +236,36 @@ void
DefaultResolver::visit (AST::ReturnExpr &expr)
{}
+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);
+
+ if (expr.get_method_name ().has_generic_args ())
+ {
+ auto &args = expr.get_method_name ().get_generic_args ();
+ for (auto &arg : args.get_generic_args ())
+ arg.accept_vis (*this);
+ for (auto &arg : args.get_binding_args ())
+ if (!arg.is_error ())
+ arg.get_type ().accept_vis (*this);
+ for (auto &arg : args.get_lifetime_args ())
+ arg.accept_vis (*this);
+ }
+
+ for (auto ¶m : expr.get_params ())
+ param->accept_vis (*this);
+}
+
void
DefaultResolver::visit (AST::LoopExpr &expr)
{}
diff --git a/gcc/rust/resolve/rust-default-resolver.h
b/gcc/rust/resolve/rust-default-resolver.h
index 13ab5ee142c..6bca8b7b6a1 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -66,6 +66,8 @@ public:
void visit (AST::RangeFromToInclExpr &);
void visit (AST::RangeToInclExpr &);
void visit (AST::ReturnExpr &);
+ void visit (AST::CallExpr &);
+ void visit (AST::MethodCallExpr &);
void visit (AST::LoopExpr &);
void visit (AST::WhileLoopExpr &);
void visit (AST::WhileLetLoopExpr &);
--
2.45.2