-
Notifications
You must be signed in to change notification settings - Fork 157
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
name resolution 2.0: Add base Resolver and TopLevel pass #2456
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CohenArthur
force-pushed
the
nr2.0-base-resolver
branch
from
July 20, 2023 12:37
6fe346b
to
a0acb1a
Compare
Noticed a couple issues already so putting it in draft, but reviews welcome! |
CohenArthur
commented
Jul 20, 2023
P-E-P
reviewed
Jul 20, 2023
CohenArthur
force-pushed
the
nr2.0-base-resolver
branch
from
July 25, 2023 23:51
a0acb1a
to
4103aa8
Compare
This was referenced Jul 26, 2023
CohenArthur
force-pushed
the
nr2.0-base-resolver
branch
2 times, most recently
from
July 31, 2023 11:39
9ab87c7
to
fa8645b
Compare
CohenArthur
force-pushed
the
nr2.0-base-resolver
branch
from
July 31, 2023 13:29
fa8645b
to
71a4aee
Compare
P-E-P
reviewed
Jul 31, 2023
P-E-P
approved these changes
Jul 31, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CohenArthur
force-pushed
the
nr2.0-base-resolver
branch
2 times, most recently
from
July 31, 2023 14:19
45e9d3d
to
73ad6fa
Compare
This commit adds a first simple `NameResolutionContext` data structure, which will be used by all passes of the name resolution to store definitions and access them. Namely, it contains a few instances of `ForeverStack`, for each namespace we will be using. gcc/rust/ChangeLog: * Make-lang.in: Add new object file. * resolve/rust-name-resolution-context.cc: New file. * resolve/rust-name-resolution-context.h: New file.
The `TopLevel` pass takes care of collecting definitions, placing them in the proper namespaces, and making them accessible for later resolution passes like `Early` and `Late`. It is meant to be run in a fixed point fashion, as import resolution, macro resolution and macro expansion may generate multiple new definitions. gcc/rust/ChangeLog: * Make-lang.in: Add new object file. * resolve/rust-toplevel-name-resolver-2.0.cc: New file. * resolve/rust-toplevel-name-resolver-2.0.h: New file.
This causes complaints by our GCC 4.8 builder. gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: assert() -> rust_assert()
CohenArthur
force-pushed
the
nr2.0-base-resolver
branch
from
August 1, 2023 14:44
73ad6fa
to
5fa332f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TopLevel
visitorThis commit adds a first simple
Resolver
data structure, which willbe used by all passes of the name resolution to store definitions and access
them. Namely, it contains a few instances of
ForeverStack
, for eachnamespace we will be using.
The
TopLevel
pass takes care of collecting definitions, placing themin the proper namespaces, and making them accessible for later resolution
passes like
Early
andLate
. It is meant to be run in a fixed pointfashion, as import resolution, macro resolution and macro expansion
may generate multiple new definitions.