aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast.h
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-10-25 16:56:09 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:13:11 +0100
commit5a9c2732d5d9bff9710466e039105cf29e35405d (patch)
treec7e639b658a3e8eaf40e4a036c7d5aaf50a512ce /gcc/rust/ast/rust-ast.h
parent7065e2dbfee8bd4088c8361158420b6667dfb8ff (diff)
downloadgcc-5a9c2732d5d9bff9710466e039105cf29e35405d.zip
gcc-5a9c2732d5d9bff9710466e039105cf29e35405d.tar.gz
gcc-5a9c2732d5d9bff9710466e039105cf29e35405d.tar.bz2
gccrs: 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>
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r--gcc/rust/ast/rust-ast.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index a497ccd..938268d 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -1862,6 +1862,7 @@ public:
NodeId get_node_id () const { return node_id; }
const std::vector<Attribute> &get_inner_attrs () const { return inner_attrs; }
+ std::vector<Attribute> &get_inner_attrs () { return inner_attrs; }
std::vector<std::unique_ptr<AST::Item>> take_items ()
{