[llvm-dev] RFC tidy-llvm.py

Chris Sears via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 16 07:11:37 PST 2021


Christian, it's suggested for the submitter to run clang-format before
submitting a patch ("How to Submit a Patch") but there isn't any similar
mention of clang-tidy. Yeah, a clang-tidy recommendation should be added
there but I needed something for out-of-tree.

Mehdi, it's possible (extremely likely) that a better understanding of the
configuration/build machinery would allow someone to do this on the command
line. I know instruction legalization with globalisel at this point, but
then I hadn't even heard of the compilation database until this week. I
think build people and clang people have a better handle on this. Middle
and backend people may tend to consume what the defaults give them.

The build still has to be configured correctly and the -p switch needs the
build directory location. Maybe clang-tidy itself could be improved to add

  1. figuring out that you're in an LLVM tree
  2. if so, finding build
  3. verifying the build configuration
  4. basically doing what tidy-llvm does

Then you could type clang-tidy llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
or even clang-tidy AsmPrinter.cpp
I'm happy I got my tidying done and I just wanted to make clang-tidy a more
approachable tool.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211216/18882e13/attachment.html>


More information about the llvm-dev mailing list