[PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'
Jonas Devlieghere via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 4 11:37:08 PDT 2016
JDevlieghere updated this revision to Diff 66835.
JDevlieghere marked 9 inline comments as done.
JDevlieghere added a comment.
- Added function pointer test case
- Used placeholders for diagnostics
I extended the matchers to include `::memcpy` and `::memset` as well because the check otherwise does not work on my mac because the `cstring` header that ships with Xcode is implemented as shown below.
This is annoying as I have no way to discriminate functions that have the same signature. Unless there's a better solution, this seems like a reasonable trade-off to me. Of course I'm open to suggestions!
In https://reviews.llvm.org/D22725#505739, @aaron.ballman wrote:
> The tests added mostly cover them -- I elaborated on the function pointer case, which I don't *think* will go wrong with this check, but should have a pathological test case for just to be sure.
I added the test case. The call is indeed replaced, which I guess is fine?
In https://reviews.llvm.org/D22725#505476, @Prazek wrote:
> Did you manage to see what was wrong in the transformation that you did on LLVM?
Not yet, thought it seemed to be related to `std::copy` rather than `std::fill`. I'm still trying to pinpoint the culprit but it's extremely time consuming as I have to recompile LLVM completely in order to run the tests...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 16837 bytes
Desc: not available
More information about the cfe-commits