aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-03-20 03:10:26 +0100
committerCohenArthur <arthur.cohen@embecosm.com>2023-03-25 08:47:56 +0000
commite10e882ddf3d0f85f36e6645c4637f9725ee2562 (patch)
treead265ba4af46d53e1fbdeccbbbcde5cfeab3e0c3 /gcc/rust/rust-session-manager.cc
parent2b52571e8aa28a100b8989ece12e929a9fb6bcf4 (diff)
downloadgcc-e10e882ddf3d0f85f36e6645c4637f9725ee2562.zip
gcc-e10e882ddf3d0f85f36e6645c4637f9725ee2562.tar.gz
gcc-e10e882ddf3d0f85f36e6645c4637f9725ee2562.tar.bz2
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/rust-session-manager.cc')
0 files changed, 0 insertions, 0 deletions