From: Pierre-Emmanuel Patry Date: Mon, 31 Jul 2023 16:31:51 +0000 (+0200) Subject: gccrs: Add proc macros abstractions to crate structure X-Git-Tag: basepoints/gcc-15~2157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ea74345459e72a8cd5b9ff00d78428893251edd;p=thirdparty%2Fgcc.git gccrs: Add proc macros abstractions to crate structure Add multiple setters for a crate object in order to add macro abstractions previously introduced. gcc/rust/ChangeLog: * ast/rust-ast.h (struct Crate): Add proc macro members. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index b78c4291e7ae..ca117842a24b 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -2026,6 +2026,10 @@ struct Crate NodeId node_id; + std::vector attribute_macros; + std::vector derive_macros; + std::vector bang_macros; + public: // Constructor Crate (std::vector> items, @@ -2088,6 +2092,16 @@ public: { items = std::move (new_items); } + + void add_bang_macro (ProcMacro::Bang macro) { bang_macros.push_back (macro); } + void add_attribute_macro (ProcMacro::Attribute macro) + { + attribute_macros.push_back (macro); + } + void add_derive_macro (ProcMacro::CustomDerive macro) + { + derive_macros.push_back (macro); + } }; // Base path expression AST node - abstract