[libc-commits] [PATCH] D77281: [libc] Add libc-tidy.

Paula Toth via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 1 17:27:12 PDT 2020


PaulkaToast created this revision.
PaulkaToast added a project: libc-project.
Herald added subscribers: libc-commits, tschuett, MaskRay, mgorny.
PaulkaToast removed a parent revision: D77277: [libc] Fix round and memcpy to adhere to qualified calls..
PaulkaToast added reviewers: sivachandra, abrachet.
PaulkaToast added a parent revision: D77277: [libc] Fix round and memcpy to adhere to qualified calls..

The libc-tidy utility will be used to implement static checks to ensure our implementation standards are met. It will contain checks that are too libc specific to be used with clang-tidy as they may interact with the build system or TableGen files.

This patch:

1. Creates a libc-tidy executable under the bin folder.
2. Adds a check to ensure that libc functions are called with their qualified names. e.g:`__llvm_libc::strcpy`. The ground truth for these function are derived from the TableGen files.
3. Adds the ability to use `LIBC-NOLINT` for special cases such as unimplemented functions.
4. Adds regressions tests for lib-tidy utility.

This patch depends on D77277 <https://reviews.llvm.org/D77277> and D77279 <https://reviews.llvm.org/D77279> to fix existing unqualified calls.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77281

Files:
  libc/utils/CMakeLists.txt
  libc/utils/HdrGen/PublicAPICommand.cpp
  libc/utils/HdrGen/PublicAPICommand.h
  libc/utils/LibcTidy/CMakeLists.txt
  libc/utils/LibcTidy/LibcTidyTool.cpp
  libc/utils/LibcTidy/TableGenUtil.cpp
  libc/utils/LibcTidy/TableGenUtil.h
  libc/utils/LibcTidy/tests/.clang-format
  libc/utils/LibcTidy/tests/CMakeLists.txt
  libc/utils/LibcTidy/tests/Test.cpp
  libc/utils/LibcTidy/tests/lit.site.cfg.in
  libc/utils/LibcTidy/tests/mock_api.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77281.254370.patch
Type: text/x-patch
Size: 13142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200402/acf42a0d/attachment-0001.bin>


More information about the libc-commits mailing list