]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add const getter for tokentrees
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 6 Sep 2023 12:09:25 +0000 (14:09 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:31 +0000 (19:09 +0100)
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.patry@embecosm.com>
gcc/rust/ast/rust-ast.h

index 70277e76fcbd35706fb66fa2e4b2628dc12326ec..9f5242ae80d7918b4cc930eefa4c856a77003732 100644 (file)
@@ -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; }
 };