This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Merge common code between llvmlibc-restrict-system-libc-headers and portability-restrict-system-includes
ClosedPublic

Authored by PaulkaToast on Mar 18 2020, 4:32 PM.

Details

Summary

Made llvmlibc::RestrictSystemLibcHeadersCheck a subclass of protability::RestrictSystemIncludesCheck to re-use common code between the two.
This also adds the ability to white list linux development headers.

Diff Detail

Event Timeline

PaulkaToast created this revision.Mar 18 2020, 4:32 PM
aaron.ballman accepted this revision.Mar 20 2020, 10:55 AM

LGTM aside from some small nits!

clang-tools-extra/clang-tidy/llvmlibc/CMakeLists.txt
16

Can you keep this list sorted in alphabetical order?

clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.h
85

Can you add a newline to the end of the file (as a drive-by)?

clang-tools-extra/docs/clang-tidy/checks/llvmlibc-restrict-system-libc-headers.rst
32

whitelist -> allow

This revision is now accepted and ready to land.Mar 20 2020, 10:55 AM
PaulkaToast marked 2 inline comments as done.

Thanks!

PaulkaToast marked an inline comment as done.Mar 20 2020, 11:59 AM
This revision was automatically updated to reflect the committed changes.
clang-tools-extra/docs/clang-tidy/checks/llvmlibc-restrict-system-libc-headers.rst