Skip to content

Use X macros to generate DefaultASTVisitor#3995

Open
powerboat9 wants to merge 1 commit into
Rust-GCC:masterfrom
powerboat9:x-mac-2
Open

Use X macros to generate DefaultASTVisitor#3995
powerboat9 wants to merge 1 commit into
Rust-GCC:masterfrom
powerboat9:x-mac-2

Conversation

@powerboat9

Copy link
Copy Markdown
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
Copy Markdown
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