-
Notifications
You must be signed in to change notification settings - Fork 163
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 ForeverStack APIs for Name Resolution 2.0 #2739
Add ForeverStack APIs for Name Resolution 2.0 #2739
Conversation
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.
Some minor comments, otherwise LGTM
bool is_lower_self_seg () const { return as_string ().compare ("self") == 0; } | ||
bool is_big_self () const { return as_string ().compare ("Self") == 0; } |
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.
Not entirely sure why is_lower_self
got renamed, shouldn't is_big_self
be renamed too ?
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.
this is for using them in a templated function, so that the API is consistent with other Path-like nodes. I think changing is_big_self
also makes sense
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.
I think we should fix this in another PR though, I'm not sure about any potential conflicts or anything later down the line
b7ffa66
to
d3b3c56
Compare
gcc/rust/ChangeLog: * ast/rust-ast.h: Change Path API to be more consistent. * ast/rust-path.h: Likewise. * ast/rust-ast-collector.cc (TokenCollector::visit): Use new API. * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise. * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise. * resolve/rust-forever-stack.hxx: Likewise.
gcc/rust/ChangeLog: * resolve/rust-rib.h: Add Namespace enum.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Improve resolve_path API. * resolve/rust-forever-stack.hxx: Likewise and fix implementation.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Add specific behavior for `ForeverStack::get` when dealing with labels.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Fix `ForeverStack::resolve_path` signature. * resolve/rust-forever-stack.hxx: Likewise. * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Use new API. (Early::visit_attributes): Likewise.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Do not copy segment when dereferencing iterator in `find_starting_point`.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: New method. * resolve/rust-forever-stack.hxx: Likewise.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: New method. * resolve/rust-forever-stack.hxx: Likewise.
gcc/rust/ChangeLog: * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Format.
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Remove debug log.
get
for Namespace::Labelsto_canonical_path
methodto_rib
methodThis PR introduces the necessary changes from #2620 in order to make late name resolution possible. Cherry-picked, cleaned up and all changelog'ed up.