aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-07-31 18:31:51 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-09-05 14:05:36 +0000
commit3c77182243784324dc733cd1f3a488edae7ad0c8 (patch)
treedb61e6e4c52ecd0b729c426f8fe022785710009c /gcc
parent76263ca000ac6d95c92074d5e4a10b3220db6ff1 (diff)
downloadgcc-3c77182243784324dc733cd1f3a488edae7ad0c8.zip
gcc-3c77182243784324dc733cd1f3a488edae7ad0c8.tar.gz
gcc-3c77182243784324dc733cd1f3a488edae7ad0c8.tar.bz2
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 037b829..80c6666 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<AttributeProcMacro> attribute_macros;
+ std::vector<CustomDeriveProcMacro> derive_macros;
+ std::vector<BangProcMacro> bang_macros;
+
public:
// Constructor
Crate (std::vector<std::unique_ptr<Item>> 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