This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Expose actOnAllPArentDirectories helper
ClosedPublic

Authored by kadircet on Feb 5 2021, 5:05 AM.

Details

Summary

Will be used in other components that need ancestor traversal.

Diff Detail

Event Timeline

kadircet created this revision.Feb 5 2021, 5:05 AM
kadircet requested review of this revision.Feb 5 2021, 5:05 AM
sammccall accepted this revision.Feb 15 2021, 5:49 AM
sammccall added inline comments.
clang-tools-extra/clangd/support/Path.h
39

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?

This revision is now accepted and ready to land.Feb 15 2021, 5:49 AM
kadircet marked an inline comment as done.Feb 15 2021, 12:41 PM

maybe we should expose absoluteParent instead?

doing that instead. also updating tidyprovider and configyamlparser to make use of this helper now, PTAL.

kadircet updated this revision to Diff 323820.Feb 15 2021, 12:41 PM
  • Expose absoluteParent instead of whole traverse action
  • Use helper in existing places that use path::parent_path for traversal
sammccall accepted this revision.Feb 15 2021, 12:49 PM

Thanks!

clang-tools-extra/clangd/ConfigProvider.cpp
100–101

absoluteParent?

I think this can be moved into the loop init now, it's not used anywhere else

clang-tools-extra/clangd/support/Path.h
37

Maybe add a hint why we use this...

"unlike sys::parent_path, does not consider C: a parent of C:\"

kadircet updated this revision to Diff 324946.Feb 19 2021, 4:34 AM
kadircet marked 2 inline comments as done.
  • Update comment.
  • Get rid of a parent_path usage.
kadircet updated this revision to Diff 324947.Feb 19 2021, 4:35 AM
  • Get rid of parent_path usage for real
This revision was landed with ongoing or failed builds.Feb 19 2021, 4:40 AM
This revision was automatically updated to reflect the committed changes.