Details
- Reviewers
aaron.ballman
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 24918 Build 24917: arc lint + arc unit
Event Timeline
These commits are available on github if it's convenient to see it all together there:
https://github.com/steveire/clang/commits/matcher-output
Here is context for the changes I'm making in case it is useful:
https://steveire.wordpress.com/2018/11/11/future-developments-in-clang-query/
Note that the commits pushed for review so far don't implement everything I wrote about there.
lib/ASTMatchers/Dynamic/Registry.cpp | ||
---|---|---|
645 | Don't use auto here (and if you did. the const would go on the other side). | |
647–651 | I think this can be replaced with llvm::find_if(). | |
659 | I'd prefer this to not be a default argument (the callers can pass it in). It might also be nice to use an enum here rather than a bool, but alternative to that, you should stick in comments in the callers that describe the parameter name. e.g. getMatchingMatchersImpl(yada, /*ExactOnly*/true); | |
711 | Don't use auto. | |
716–718 | Why do these need their own inner block scopes? | |
719 | auto. | |
720–721 | if (TypeForMatcherOpt && StaticType.isBaseOf(...)) { | |
722–723 | auto, here and everywhere in this file. | |
749 | Can remove whitespace around here. | |
761–766 | It seems like getMatchingMatchersImpl() should just be renamed to getMatchingMatchers(). |
@aaron.ballman
I think the auto usage improves and simplifies the code, however, as I would really like to see this code landed, I would be ok to help Stephen to finish this work and replace auto by the "old" way. Do you think we can have this approved if we make the changes mentioned earlier?
Nothing jumps out at me as blocking this, aside from completing the usual review activities. Have at it!
@aaron.ballman I think we agreed in Belfast in November (after the most recent comment) to get this in as it is and not be as draconian about auto. Is anything blocking this?
Nothing is blocking this, but I think we may have slightly different understandings of what we agreed to. Reviewers asking for code to follow the coding guidelines is not draconian; it's expected for code to follow the coding guidelines and for patch authors to field requests for changes like these. I re-reviewed the things I was asking for changes on and have added a comment where I definitely insist on changes. LGTM with that nit fixed though.
lib/ASTMatchers/Dynamic/Registry.cpp | ||
---|---|---|
731 | Please change this use of auto -- I have no idea what the type is for NestedResult without hunting for it and so I have no idea what the type is for Item and whether using a const reference is reasonable or not (after doing the hunting, it looks fine though). |
targetCtor -> TargetCtor