[clang-tidy] Add module for llvm-libc and restrict-system-libc-header-check.
authorPaula Toth <paulatoth@google.com>
Thu, 12 Mar 2020 18:38:05 +0000 (11:38 -0700)
committerPaula Toth <paulatoth@google.com>
Thu, 12 Mar 2020 18:46:05 +0000 (11:46 -0700)
commiteb41cc619866ea3b12a30f734600ac86699ce05e
tree45ad7788d992dd2e0f06f478007e7485d9e63517
parent360aff0493e6d089c592e5954024795ead0c69d1
[clang-tidy] Add module for llvm-libc and restrict-system-libc-header-check.

Summary: This adds a new module to enforce standards specific to the llvm-libc project. This change also adds the first check which restricts user from including system libc headers accidentally which can lead to subtle bugs that would be a challenge to detect.

Reviewers: alexfh, hokein, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: juliehockett, arphaman, jfb, abrachet, sivachandra, Eugene.Zelenko, njames93, mgorny, xazax.hun, MaskRay, cfe-commits

Tags: #clang-tools-extra, #libc-project, #clang

Differential Revision: https://reviews.llvm.org/D75332
19 files changed:
clang-tools-extra/clang-tidy/CMakeLists.txt
clang-tools-extra/clang-tidy/ClangTidyForceLinker.h
clang-tools-extra/clang-tidy/llvmlibc/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/clang-tidy/llvmlibc/LLVMLibcTidyModule.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/llvmlibc-restrict-system-libc-headers.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/resource/include/stdatomic.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/resource/include/stddef.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/system/math.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/system/stdio.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/system/stdlib.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/system/string.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/llvmlibc/transitive.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/llvmlibc-restrict-system-libc-headers-transitive.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/llvmlibc-restrict-system-libc-headers.cpp [new file with mode: 0644]