-
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
Cleanup macro invoc #2981
base: master
Are you sure you want to change the base?
Cleanup macro invoc #2981
Conversation
ok i appear to have developed this from another branch other than master, fixing it rn |
Remove get_macro_node_id in favor of get_node_id in MacroInvocation Add ExteralItem node_id constructor to avoid extra get_node_id() gcc/rust/ChangeLog: * ast/rust-macro.h: Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise. * util/rust-hir-map.cc (Mappings::insert_macro_invocation): Likewise. (Mappings::lookup_macro_invocation): Likewise. (Mappings::insert_bang_proc_macro_invocation): Likewise. (Mappings::lookup_bang_proc_macro_invocation): Likewise.
9a64b91
to
8cf484d
Compare
@CohenArthur hi Arthur i'm not sure for things like node_id and locus, if you want to not explicitly declare them in MacroInvocation and just get_node_id and get_locus from the parent's class or if you just want to do them explicitly like what I've kept in the modification? Also not sure what else needs to be clean up for this class.. |
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 this is already a good cleanup - I need to have a think about how exactly we can take it further. I'll come back to this later :) thank you!
if (has_semicolon) | ||
source_node = invoc.get_macro_node_id (); | ||
source_node = invoc.get_node_id (); | ||
else | ||
source_node = invoc.get_node_id (); |
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.
see for example here we're no longer doing anything different if the macro has a semicolon or not, so we can remove the if
block
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.
wow no idea how i missed this, thanks for the review, i'll resolve it along with new thoughts on this
I don't get your changelog message:
There is nothing to be like, how could the first statement be |
Purely an oversight from my end. I'll update it once the PR needs work again. |
MacroInvoc Refactor for #2919