Skip to content
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

Add use declaration resolution #2742

Merged

Conversation

CohenArthur
Copy link
Member

@CohenArthur CohenArthur commented Nov 15, 2023

  • early: Resolve paths properly
  • toplevel: Add comment about running the collector twice
  • ast: Add NodeId to UseTree base class
  • early: Move use declaration resolving to TopLevel
  • toplevel: Resolve use declarations

Needs #2740
Needs #2739

@CohenArthur CohenArthur force-pushed the add-use-tree-name-resolution-2.0 branch from 64beffe to 39b5e02 Compare November 22, 2023 13:30
* can call this function each time the early name resolution pass is underway
* and it will not trigger assertions for already resolved invocations.
*/
// TODO: Rename
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you want to rename here ?

@CohenArthur CohenArthur force-pushed the add-use-tree-name-resolution-2.0 branch from 39b5e02 to 6572c4f Compare November 28, 2023 14:36
gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc
	(Early::insert_once): New function.
	(Early::visit): Likewise.
	* resolve/rust-early-name-resolver-2.0.h: Likewise.
gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc
	(TopLevel::insert_or_error_out): Add documentation comment.
	(TopLevel::go): Likewise.
gcc/rust/ChangeLog:

	* ast/rust-item.h (class UseTree): Add `node_id` member.
gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc
	(Early::visit): Remove visitors.
	* resolve/rust-early-name-resolver-2.0.h: Likewise.
gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc
	(TopLevel::insert_or_error_out): New functions.
	(TopLevel::handle_use_dec): New function.
	(flatten_rebind): Likewise.
	(flatten_list): Likewise.
	(flatten_glob): Likewise.
	(flatten): Likewise.
	(TopLevel::visit): Visit various `use` declaration nodes.
	* resolve/rust-toplevel-name-resolver-2.0.h: Declare functions and
	visitors.
@CohenArthur CohenArthur added this pull request to the merge queue Nov 28, 2023
Merged via the queue into Rust-GCC:master with commit 7089200 Nov 28, 2023
9 checks passed
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.

2 participants