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

Paula Toth via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 20 23:25:49 PDT 2020


PaulkaToast marked an inline comment as done.
PaulkaToast added inline comments.


================
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.
----------------
sivachandra wrote:
> 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`?
Yeah, I'm not the biggest fan of this fallback that's why I made the TODO.

I liked the idea of disabling the check since most compiler do support the `--print-resource-dir` flag.

As for where the rule lives I think your suggestion is good. I'll update the revision accordingly (:


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