[PATCH] D96123: [clangd] Expose actOnAllPArentDirectories helper

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 15 05:49:21 PST 2021


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/support/Path.h:33
+// deepest directory and going up to root. Stops whenever action succeeds.
+void actOnAllParentDirectories(PathRef FileName,
+                               llvm::function_ref<bool(PathRef)> Action);
----------------
The signature is a bit weird here,
 - prone to boolean-sense mistakes
 - it's not obvious it only works on absolute paths
 - the loop isn't hard to write

maybe we should expose absoluteParent instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96123



More information about the cfe-commits mailing list