https://gcc.gnu.org/g:b5118d1a6aa6dc2256d3f4620eb3185389531689
commit b5118d1a6aa6dc2256d3f4620eb3185389531689 Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Date: Wed Sep 6 14:09:25 2023 +0200 Add const getter for tokentrees We often need to retrieve the underlying tokentree without modifying it, this getter will help achieve this. gcc/rust/ChangeLog: * ast/rust-ast.h: Add const getter. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Diff: --- gcc/rust/ast/rust-ast.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index e5cadb673148..a2d088e05947 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -901,6 +901,11 @@ public: return token_trees; } + const std::vector<std::unique_ptr<TokenTree>> &get_token_trees () const + { + return token_trees; + } + DelimType get_delim_type () const { return delim_type; } };