Skip to content

Use X macros to generate DefaultASTVisitor #3995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

powerboat9
Copy link
Collaborator

This is a bit messy, but basing default AST visitation on a descriptive DSL is probably one of our best options for regularizing AST visitors. clang-format is disabled in ast/rust-ast-visitable-inner.h, since I'm not sure how to get it to handle the DSL well.

@powerboat9
Copy link
Collaborator Author

It looks like https://clang.llvm.org/docs/ClangFormatStyleOptions.html#macros would be useful, whenever we bump clang-format to version 17

@powerboat9 powerboat9 force-pushed the x-mac-2 branch 4 times, most recently from 4188adf to a700bfe Compare July 28, 2025 15:47
This should help us reduce mismatches between DefaultASTVisitor and
ExpandVisitor later.

clang-format is disabled for "ast/rust-ast-visitable-inner.h", as it
doesn't seem to handle the macro shenanagins used very well.

gcc/rust/ChangeLog:

	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Remove
	explicit definitions, use X macros.
	* ast/rust-ast-visitable-inner.h: New file.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant