aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/Make-lang.in
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-03-20 03:10:26 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:28:38 +0100
commita7382ca757ed535e7bc74782038104ef5ac59694 (patch)
tree939a5582f211aa160731b65b3feb4972b6460bda /gcc/rust/Make-lang.in
parent9946ef210f40985ce8ab7e5faae43b23f08988a8 (diff)
downloadgcc-a7382ca757ed535e7bc74782038104ef5ac59694.zip
gcc-a7382ca757ed535e7bc74782038104ef5ac59694.tar.gz
gcc-a7382ca757ed535e7bc74782038104ef5ac59694.tar.bz2
gccrs: expand: Move cfg-attrs related functions out of MacroExpander
The current situation where the MacroExpander and AttrVisitor recursively call into each other is not great, and causes pains for macro imports. We need to split this pass in two, with one pass being responsible for cfg-attr checking and stripping, and one being responsible for macro expansion. gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Do not cfg-attr strip in MacroExpander (MacroExpander::fails_cfg): Function moved... (MacroExpander::fails_cfg_with_expand): Function moved... (MacroExpander::expand_cfg_attrs): Function moved... * expand/rust-attribute-visitor.cc (fails_cfg): ...here. (fails_cfg_with_expand): ...here. (expand_cfg_attrs): ...here. (AttrVisitor::expand_struct_fields): Use new functions. (AttrVisitor::expand_tuple_fields): Likewise. (AttrVisitor::expand_function_params): Likewise. (AttrVisitor::visit): Likewise. (AttrVisitor::go): New function. * expand/rust-attribute-visitor.h: Declare AttrVisitor::go. * expand/rust-macro-expand.h (struct MacroExpander): Remove cfg-attr related functions.
Diffstat (limited to 'gcc/rust/Make-lang.in')
0 files changed, 0 insertions, 0 deletions