]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add a default AST visitor
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 25 Oct 2023 14:56:09 +0000 (16:56 +0200)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 6 Nov 2023 17:13:22 +0000 (17:13 +0000)
commit4068593c22cbc5c319ccdb4596eeb512aa0b820a
tree889ce197efc0380e431f1bc34466da193c84f179
parentebe2f98aa53ef5ac7c0097f8fd87c9a713b50e07
Add a default AST visitor

This will allow us to derive other visitors from it and overload only a
few selected visit methods.

gcc/rust/ChangeLog:

* Make-lang.in: Add the new visitor object file.
* ast/rust-ast-visitor.h (class DefaultASTVisitor): Create the default
visitor class.
* ast/rust-ast.h: Add a new reference getter for visitor pattern.
* ast/rust-ast-visitor.cc: New file.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/Make-lang.in
gcc/rust/ast/rust-ast-visitor.cc [new file with mode: 0644]
gcc/rust/ast/rust-ast-visitor.h
gcc/rust/ast/rust-ast.h