[libc-commits] [PATCH] D80265: [libc] Make clang-tidy use host compiler's resource dir.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 20 23:06:05 PDT 2020


sivachandra added a comment.

I think I understand the problem with clang-tidy that you are trying to solve here. Also, I like the overall idea of this patch. But, see my inline comment.



================
Comment at: libc/cmake/modules/LLVMLibCHeaderRules.cmake:131
+
+  # Fallback if --print-resource-dir is not supported by the compiler.
+  # TODO, see if there is a better way to do this.
----------------
This fallback seems more confusing than useful. For example, will it find `stddef.h` from /usr/include or will it find `stddef.h` from the compiler's resource dir? Perhaps a better alternate is to compile a stub using the `-E` option and grep out the path to `stddef.h`.

To keep it simple, may be we should just disable the header file check when we can't get the resource dir?

One minor point, this check is really not a rule. So, can we just put this whole function not as a function in `libc/CMakeLists.txt`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80265/new/

https://reviews.llvm.org/D80265





More information about the libc-commits mailing list