aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-dump.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-11-15 11:01:12 +0000
committerGitHub <noreply@github.com>2022-11-15 11:01:12 +0000
commit815a57351a33491e534cc1b6c6ddfa17eaf2b500 (patch)
tree292bb3744e1908b39e0bfbfdb1e54aab3e2d2760 /gcc/rust/ast/rust-ast-dump.h
parent009337f5935882799fe520e98f0b233403254e41 (diff)
parent22977337faf0c1a80af36b00249aed30fa586f2d (diff)
downloadgcc-815a57351a33491e534cc1b6c6ddfa17eaf2b500.zip
gcc-815a57351a33491e534cc1b6c6ddfa17eaf2b500.tar.gz
gcc-815a57351a33491e534cc1b6c6ddfa17eaf2b500.tar.bz2
Merge #1631
1631: Ast dump where clause r=CohenArthur a=jdupak Adds dump of the where clause and recursively needed nodes. Adds visitor compatibility layer for general references except for unique pointers - needed for lifetimes. The enable is necessary to coexist with the unique_ptr overload. Depends on #1624 and will be rebased when it is merged. Co-authored-by: Jakub Dupak <dev@jakubdupak.com>
Diffstat (limited to 'gcc/rust/ast/rust-ast-dump.h')
-rw-r--r--gcc/rust/ast/rust-ast-dump.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.h b/gcc/rust/ast/rust-ast-dump.h
index 13c9212..2bd3b31 100644
--- a/gcc/rust/ast/rust-ast-dump.h
+++ b/gcc/rust/ast/rust-ast-dump.h
@@ -81,6 +81,11 @@ private:
template <typename T> void visit (std::unique_ptr<T> &node);
/**
+ * @see visit<std::unique_ptr<T>>
+ */
+ template <typename T> void visit (T &node);
+
+ /**
* Visit all items in given @collection, placing the separator in between but
* not at the end.
* Start and end offset allow to visit only a "slice" from the collection.
@@ -122,14 +127,16 @@ private:
std::unique_ptr<BlockExpr> &block);
void visit (FunctionParam &param);
- void visit (const Attribute &attrib);
- void visit (const Visibility &vis);
+ void visit (Attribute &attrib);
+ void visit (Visibility &vis);
void visit (std::vector<std::unique_ptr<GenericParam>> &params);
void visit (TupleField &field);
void visit (StructField &field);
- void visit (const SimplePathSegment &segment);
+ void visit (SimplePathSegment &segment);
void visit (NamedFunctionParam &param);
void visit (MacroRule &rule);
+ void visit (WhereClause &rule);
+ void visit (std::vector<LifetimeParam> &for_lifetimes);
// rust-ast.h
void visit (Token &tok);