gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Cleanup macro invoc

Open badumbatish opened this issue 1 year ago • 4 comments

MacroInvoc Refactor for #2919

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.

badumbatish avatar May 08 '24 17:05 badumbatish

ok i appear to have developed this from another branch other than master, fixing it rn

badumbatish avatar May 08 '24 17:05 badumbatish

@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..

badumbatish avatar May 08 '24 17:05 badumbatish

I don't get your changelog message:

        * 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.

There is nothing to be like, how could the first statement be likewise ? In case you meant "Like stated in the commit message" I would suggest duplicating the message because IIRC changelog may be cut from the commit message to be put in the changelog file.

P-E-P avatar Sep 10 '24 11:09 P-E-P

I don't get your changelog message:

        * 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.

There is nothing to be like, how could the first statement be likewise ? In case you meant "Like stated in the commit message" I would suggest duplicating the message because IIRC changelog may be cut from the commit message to be put in the changelog file.

Purely an oversight from my end. I'll update it once the PR needs work again.

badumbatish avatar Sep 10 '24 17:09 badumbatish