Extended the matched assignment operators when checking for bound changes in a body of the loop. This updated list covers all the (current) possible assignments.
NoQ dcoughlin xazax.hun zaks.anna klimek aaron.ballman george.karpenkov
- rG4c87d233b07c: [analyzer] LoopUnrolling: update the matched assignment operators
rL328619: [analyzer] LoopUnrolling: update the matched assignment operators
rC328619: [analyzer] LoopUnrolling: update the matched assignment operators
Maybe instead of enumerating all the assignment operators here it would be better to have a matcher that checks isAssignmentOp for CXXOperatorCalls/BinaryOperators? This would be less error prone and more future proof.
Thanks Gabor, i didn't think about it but it looks very nice to have such matcher.
I think the matcher shouldn't be checker-local, but shared into ASTMatchers.h all other matchers - not only this matcher is universally useful, but also i have weird vague memories that matchers may collide by name if defined in different translation units differently (if this is indeed this way then having the same matcher in multiple places is very bad).
Not sure how clang/docs/LibASTMatchersReference.html is supposed to be updated.
|3931 ↗||(On Diff #123176)|
-/// \brief Matches all kind of assignment operators. +/// \brief Matches all kinds of assignment operators.
|3938 ↗||(On Diff #123176)|
Needs unittests, probably in clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp ?