[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

Radosław Śnieżek via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 02:30:34 PST 2024


rsniezek wrote:

you are right, when prepended path to clang headres the check don't crash even with full compile commands after the --
```
/run/current-system/sw/bin/clang-tidy --checks=* -p /home/rsniezek/workspace/testings_stuff/build --extra-arg-before=--driver-mode=g++ /home/rsniezek/workspace/testings_stuff/main.cpp -- /run/current-system/sw/bin/c++  -isystem /nix/store/wh3j8a20d27npyvn2f83w0vl6hw4x9vy-clang-wrapper-17.0.6/resource-root/include -isystem /nix/store/lbamp822r4dmq2f7vizvswbilk83awsr-gcc-13.2.0/include/c++/13.2.0 -isystem /nix/store/lbamp822r4dmq2f7vizvswbilk83awsr-gcc-13.2.0/include/c++/13.2.0/x86_64-unknown-linux-gnu -isystem /nix/store/lbamp822r4dmq2f7vizvswbilk83awsr-gcc-13.2.0/include/c++/13.2.0/backward -isystem /nix/store/lbamp822r4dmq2f7vizvswbilk83awsr-gcc-13.2.0/lib/gcc/x86_64-unknown-linux-gnu/13.2.0/include -isystem /nix/store/lbamp822r4dmq2f7vizvswbilk83awsr-gcc-13.2.0/include -isystem /nix/store/lbamp822r4dmq2f7vizvswbilk83awsr-gcc-13.2.0/lib/gcc/x86_64-unknown-linux-gnu/13.2.0/include-fixed -isystem /nix/store/3mmvgb08qy8n6n37mnprf77fnp4rssi9-glibc-2.38-27-dev/include -isystem /nix/store/wh3j8a20d27npyvn2f83w0vl6hw4x9vy-clang-wrapper-17.0.6/resource-root/include -std=gnu++23 -fPIE -MD -MT CMakeFiles/testexe.dir/main.cpp.o -MF CMakeFiles/testexe.dir/main.cpp.o.d -o CMakeFiles/testexe.dir/main.cpp.o -c /home/rsniezek/workspace/testings_stuff/main.cpp
11330 warnings generated.
/home/rsniezek/workspace/testings_stuff/main.cpp:1:1: warning: system include xmmintrin.h not allowed [llvmlibc-restrict-system-libc-headers]
    1 | #include <xmmintrin.h>
      | ^
note: this fix will not be applied because it overlaps with another fix
/home/rsniezek/workspace/testings_stuff/main.cpp:1:1: warning: included header xmmintrin.h is not used directly [misc-include-cleaner]
note: this fix will not be applied because it overlaps with another fix
/home/rsniezek/workspace/testings_stuff/main.cpp:3:5: warning: declaration must be declared within the '__llvm_libc' namespace [llvmlibc-implementation-in-namespace]
    3 | int main() { return 0; }
      |     ^
/home/rsniezek/workspace/testings_stuff/main.cpp:3:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
    3 | int main() { return 0; }
      | ~~~ ^
      | auto       -> int
Suppressed 11326 warnings (11326 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
```

Can this extra path be added with  the extra-args[-before]? I seem to be unable to do this correctly.

https://github.com/llvm/llvm-project/pull/66553


More information about the cfe-commits mailing list