Skip to content

Commit

Permalink
Add dump option to show node
Browse files Browse the repository at this point in the history
Add a new dump option to show node node as
internal comment with a blacklist to ignore some
node.

gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::begin_internal_comment):
	Add internal comment to print node beginning.
	(TokenCollector::end_internal_comment): Add internal comment to print
	node end.
	(TokenCollector::visit): Add the comments of the node visited.
	(TokenCollector::visit_closure_common): Likewise.
	(TokenCollector::visit_loop_common): Likewise.
	* ast/rust-ast-collector.h: Add internal comment as a nes Kind.
	* ast/rust-ast-dump.cc (Dump::Dump): add a Dump constructor to enable
	internal.
	* ast/rust-ast-dump.h: Add printing of internal comment in the dump
	* rust-session-manager.cc (Session::enable_dump): Activate ast dump
	and fill the blacklist.
	(Session::handle_internal_blacklist): Parse the flag to get node to
	be blacklisted.
	(Session::compile_crate): Launch ast dump internal when asked.
	(Session::dump_ast_pretty_internal): Call the visitor to dump
	the internals.
	* rust-session-manager.h (struct CompileOptions): add Interal in
	Dump option enum.

Signed-off-by: Benjamin Thos <[email protected]>
  • Loading branch information
Kamiinarii committed Oct 22, 2024
1 parent 71d2084 commit 9e874a5
Show file tree
Hide file tree
Showing 6 changed files with 822 additions and 3 deletions.
Loading

0 comments on commit 9e874a5

Please sign in to comment.