Pull request 1086 in include-what-you-use: Remove fruitless Base::Visit calls

0 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
Jul 24, 2022, 3:33:48 PM7/24/22
to include-wh...@googlegroups.com
New pull request 1086 by kimgr: Remove fruitless Base::Visit calls
https://github.com/include-what-you-use/include-what-you-use/pull/1086

The IwyuBaseAstVisitor has a base class, BaseAstVisitor, but it only has a
small number of Visit functions implemented, for logging.

So there is no need to call Base::VisitX in general, only for the few with
an implementation that actually does something, and they are preserved
here.


notifi...@include-what-you-use.org

unread,
Jul 24, 2022, 4:18:33 PM7/24/22
to include-wh...@googlegroups.com
Comment #1 on pull request 1086 by bolshakov-a: Remove fruitless Base::Visit calls
https://github.com/include-what-you-use/include-what-you-use/pull/1086

What if some realization will be added to BaseAstVisitor in the future?


notifi...@include-what-you-use.org

unread,
Jul 24, 2022, 4:38:59 PM7/24/22
to include-wh...@googlegroups.com
Comment #2 on pull request 1086 by kimgr: Remove fruitless Base::Visit calls
https://github.com/include-what-you-use/include-what-you-use/pull/1086

@bolshakov-a Yeah, it might happen, but the way I understand `BaseAstVisitor` it is very bare-bones and shouldn't contain any significant logic.

This was mostly for consistency -- all the places that called `Base::Visit...` were added later in IWYU's lifetime, after the original authors had jumped ship. So it looked like their original intent was _not_ to call it.

If we need some kind of base functionality in the future, I think we should consistently fix all `Visit` methods first.


Reply all
Reply to author
Forward
0 new messages