Skip to content

Commit aa6ae96

Browse files
committed
Merge remote-tracking branch 'origin/main' into next
2 parents fc60842 + dc60996 commit aa6ae96

File tree

96 files changed

+3834
-4960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3834
-4960
lines changed

include/swift/AST/ASTWalker.h

+25
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
namespace swift {
2121

22+
class ArgumentList;
2223
class Decl;
2324
class Expr;
2425
class ClosureExpr;
@@ -245,6 +246,30 @@ class ASTWalker {
245246
/// traversal is terminated and returns failure.
246247
virtual bool walkToParameterListPost(ParameterList *PL) { return true; }
247248

249+
/// This method is called when first visiting an argument list before walking
250+
/// into its arguments.
251+
///
252+
/// \param ArgList The argument list to walk.
253+
///
254+
/// \returns a pair indicating whether to visit the arguments, along with
255+
/// the argument list that should replace this argument list in the tree. If
256+
/// the latter is null, the traversal will be terminated.
257+
///
258+
/// The default implementation returns \c {true, ArgList}.
259+
virtual std::pair<bool, ArgumentList *>
260+
walkToArgumentListPre(ArgumentList *ArgList) {
261+
return {true, ArgList};
262+
}
263+
264+
/// This method is called after visiting the arguments in an argument list.
265+
/// If it returns null, the walk is terminated; otherwise, the
266+
/// returned argument list is spliced in where the old argument list
267+
/// previously appeared.
268+
///
269+
/// The default implementation always returns the argument list.
270+
virtual ArgumentList *walkToArgumentListPost(ArgumentList *ArgList) {
271+
return ArgList;
272+
}
248273

249274
protected:
250275
ASTWalker() = default;

0 commit comments

Comments
 (0)