llvm::sys::path is used a lot in the remote index marshalling code. We can save space by avoiding spelling it out explicitly for most functions and times.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp | ||
---|---|---|
61–62 | llvm::sys::path::is_absolute(RemoteIndexRoot) => is_absolute(RemoteIndexRoot) ? | |
68–69 | llvm::sys::path::is_absolute(LocalIndexRoot) => is_absolute(LocalIndexRoot) ? | |
318 | llvm::sys::path::convert_to_slash(RelativePath) => convert_to_slash(RelativePath) ? |
The ones you proposed would not work without using llvm::sys::path::* which I avoid :( They have to have an argument from llvm::sys::path:: in order for the lookup to be performed correctly.
I am not really keen about trusting ADL for these, as it makes the code less explicit for reader, especially as it is not something we commonly depend on clangd so readers/reviewers would not be expecting that. So I believe we should not stray away from the general project style in here.
Though I am a fan of not spelling llvm::sys::path bazillion times. What about having either a using namepsace for it or, using declarations for the individual symbols we are using (e.g. Style, covnert_to_slash and is_absolute)? This would also help with not spelling qualifiers over and over again in the argument names.
clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp | ||
---|---|---|
31 | nit: I would move those into clang::clangd::remote (i.e. between namespace remote { and namespace {. |
nit: I would move those into clang::clangd::remote (i.e. between namespace remote { and namespace {.