]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add getters for different types of proc macros
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 1 Aug 2023 09:20:00 +0000 (11:20 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:33 +0000 (19:04 +0100)
Add some getters on the ast crate in order to be able to retrieve a
reference to a crate's proc macros.

gcc/rust/ChangeLog:

* ast/rust-ast.h: Add getters.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast.h

index ca117842a24bb86ebd47ad67bae0922a09b2a901..7b2561ee31c0a1fb45332b4cb17481809ad80f74 100644 (file)
@@ -2083,6 +2083,21 @@ public:
   NodeId get_node_id () const { return node_id; }
   const std::vector<Attribute> &get_inner_attrs () const { return inner_attrs; }
 
+  const std::vector<AttributeProcMacro> &get_attribute_macros () const
+  {
+    return attribute_macros;
+  }
+
+  const std::vector<CustomDeriveProcMacro> &get_derive_macros () const
+  {
+    return derive_macros;
+  }
+
+  const std::vector<BangProcMacro> &get_bang_macros () const
+  {
+    return bang_macros;
+  }
+
   std::vector<std::unique_ptr<AST::Item>> take_items ()
   {
     return std::move (items);