diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-06-02 11:41:53 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-06-08 14:32:35 +0200 |
commit | 855a62d13054bd3183cebce05f5ca9ec1ee4b401 (patch) | |
tree | b132bbf05ecf44c1086f37ac0cd4aaa1e8392ea3 /gcc/rust/resolve | |
parent | 3fcec13b136cc8cb3eb58b80dd53af885ba3c998 (diff) | |
download | gcc-855a62d13054bd3183cebce05f5ca9ec1ee4b401.zip gcc-855a62d13054bd3183cebce05f5ca9ec1ee4b401.tar.gz gcc-855a62d13054bd3183cebce05f5ca9ec1ee4b401.tar.bz2 |
expand: Move derive system to new one
Builtin derive already had their own code scheme, incompatible with the
proc macro pattern. This commit unifies derive macros with it.
gcc/rust/ChangeLog:
* ast/rust-ast-fragment.cc (Fragment::Fragment): Remove
overwrite member in constructor.
(Fragment::operator=): Removal of overwrite member in copy.
(Fragment::should_overwrite): Remove overwrite getter.
* ast/rust-ast-fragment.h: Remove overwrite boolean member.
* expand/rust-expand-visitor.cc (derive_item): Add a function to
derive items using the expander for now.
(builtin_derive_item): Rename from derive_item to
builtin_derive_item.
(ExpandVisitor::visit): Remove visit to derive attributes.
(ExpandVisitor::expand_derive): Remove derive attribute visitor.
(ExpandVisitor::visit_attrs_with_derive): Likewise.
* expand/rust-expand-visitor.h: Update insertion of other kind
of proc macros. We no longer have an overwrite attribute in the
fragment.
* expand/rust-macro-expand.cc (MacroExpander::parse_procmacro_output):
Return the fragment instead of inserting it.
* expand/rust-macro-expand.h (struct MacroExpander): Return
fragment.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve')
0 files changed, 0 insertions, 0 deletions