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 base for late name resolution 2.0 #2740

Merged

Conversation

CohenArthur
Copy link
Member

  • ctx: Add Labels ForeverStack to the resolver.
  • nr2.0: Add base for late name resolution
  • toplevel: Use DefaultResolver for Function
  • nr2.0: Store mappings in NameResolutionContext
  • late: Start setting up builtin types
  • late: Start storing mappings properly in the resolver

Needs #2739

@CohenArthur CohenArthur force-pushed the add-base-for-late-name-resolution branch from 7a67c86 to 519023b Compare November 21, 2023 15:34
Copy link
Member

@P-E-P P-E-P left a comment

Choose a reason for hiding this comment

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

Looks good :)

{"f64", new TyTy::FloatType (next_id (), TyTy::FloatType::F64)},
{"usize", new TyTy::USizeType (next_id ())},
{"isize", new TyTy::ISizeType (next_id ())},
// missing char, str, never, ()
Copy link
Member

Choose a reason for hiding this comment

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

Will you add those in this PR ?

Not sure if dealing with "labels" is the proper way of doing so, so we
might eventually change this to use `resolver.values` later on.

gcc/rust/ChangeLog:

	* resolve/rust-name-resolution-context.h: Add a Labels stack.
gcc/rust/ChangeLog:

	* Make-lang.in: Compile late name resolver.
	* resolve/rust-late-name-resolver-2.0.cc: New file.
	* resolve/rust-late-name-resolver-2.0.h: New file.
gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use
	the DefaultResolver in the toplevel visitor.
gcc/rust/ChangeLog:

	* resolve/rust-name-resolution-context.h: Store a reference to the
	mappings.
	* resolve/rust-name-resolution-context.cc
	(NameResolutionContext::NameResolutionContext): Likewise.
gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::setup_builtin_types): New function.
	(Late::go): Setup builtin types.
	* resolve/rust-late-name-resolver-2.0.h:
	* resolve/rust-name-resolution-context.cc
	(NameResolutionContext::map_usage): New function.
	* resolve/rust-name-resolution-context.h: Likewise.
gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Store mappings
	after having resolved them.
	* resolve/rust-late-name-resolver-2.0.h: Add `TypePath` visitor.
@CohenArthur CohenArthur added this pull request to the merge queue Nov 22, 2023
@CohenArthur CohenArthur force-pushed the add-base-for-late-name-resolution branch from 519023b to 3fbc2a8 Compare November 22, 2023 13:29
Merged via the queue into Rust-GCC:master with commit f9a5838 Nov 22, 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