[PATCH] D22725: [clang-tidy] Add check 'misc-replace-memcpy'

Jonas Devlieghere via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 23 02:12:44 PDT 2016


JDevlieghere created this revision.
JDevlieghere added a reviewer: alexfh.
JDevlieghere added a subscriber: cfe-commits.
JDevlieghere added a project: clang-tools-extra.

This check emits a warning when memcpy is used and suggest replacing it with a call to std::copy. 

Using std::copy opens up the possibility of type-aware optimizations which are not possible with memcpy.  

Taken from: https://llvm.org/bugs/show_bug.cgi?id=22209 

https://reviews.llvm.org/D22725

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/MiscTidyModule.cpp
  clang-tidy/misc/ReplaceMemcpyCheck.cpp
  clang-tidy/misc/ReplaceMemcpyCheck.h
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/misc-replace-memcpy.rst
  test/clang-tidy/misc-replace-memcpy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22725.65221.patch
Type: text/x-patch
Size: 7486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160723/084a6f39/attachment-0001.bin>


More information about the cfe-commits mailing list