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

Collect lang items during AST #3274

Closed
wants to merge 2 commits into from

Conversation

CohenArthur
Copy link
Member

@CohenArthur CohenArthur commented Nov 27, 2024

In order to have lang items paths, we need to be able to resolve these lang items to their definition point which is impossible in the current system, as lang items are only saved in the mappings during lowering (and thus after name resolution). This small visitor collects lang items and stores their NodeIds in the mappings for an easy resolution.

Draft because I need to deduplicate some methods, but reviews welcome. Needs #3273 so ignore the first two commits

@CohenArthur CohenArthur added this to the Lang items path fixes milestone Nov 27, 2024
@CohenArthur CohenArthur force-pushed the collect-lang-items branch 3 times, most recently from e845c92 to 0f53d2f Compare December 4, 2024 13:12
gcc/rust/ChangeLog:

	* util/rust-hir-map.h: Keep a NodeId mappings for lang items.
	* util/rust-hir-map.cc (Mappings::insert_lang_item_node): New function.
	(Mappings::lookup_lang_item_node): Likewise.
gcc/rust/ChangeLog:

	* Make-lang.in: Add new object file.
	* rust-session-manager.cc (Session::compile_crate): Call CollectLangItems.
	* ast/rust-collect-lang-items.cc: New file.
	* ast/rust-collect-lang-items.h: New file.
@CohenArthur
Copy link
Member Author

Closing this since I messed it up and will open another PR with the fixes

@CohenArthur CohenArthur closed this Dec 4, 2024
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