[PATCH] D138491: [clangd] Add script to maintain list of fast clang-tidy checks

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 23 01:54:43 PST 2022


sammccall marked 3 inline comments as done.
sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/TidyFastChecks.py:41
+def read_old_fast(path):
+    text = subprocess.check_output(["cpp", "-P", "-FAST(C,T)=C", path])
+    for line in text.splitlines():
----------------
kadircet wrote:
> what does `-P` do? shouldn't the latter be `-DFAST`?
-P avoids emitting `# 0 /path/to/Sema.cpp` lines. Added comments

Fixed `-DFAST`, I must have somehow mangled this after running it!


================
Comment at: clang-tools-extra/clangd/TidyFastChecks.py:83
+    print(f"{decision} {check} {time}% <= {threshold}%", file=sys.stderr)
+    print(f"{decision}({check}, {time})")
+
----------------
kadircet wrote:
> i don't see the point in including delta in the output if we're also making the decision here. is it mostly for debugging purposes? e.g. when updating the list we get to see the difference?
Yes, that's exactly the reason. Can make it a comment instead if you like, but that makes ad-hoc analysis slightly harder.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138491



More information about the cfe-commits mailing list