[PATCH] D42638: [clangd] Add a fallback directory for collected symbols with relative paths.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 29 06:08:32 PST 2018
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:41
+ llvm::cl::desc(
+ "For symbols' file paths that cannot be resolved to absolute "
+ "paths (i.e. in-memory VFS without absolute paths), "
----------------
I have trouble understanding this.
"fallback dir" is maybe too vague a name for this flag - "assume-header-directory" or "header-base-dir" or something?
The description assumes some context about the problem - can we provide it?
Maybe:
The index includes the header that a symbol is defined in.
If the absolute path cannot be determined (e.g. an in-memory VFS) then
the relative path is resolved against this directory, which must be absolute.
If this flag is not given, such headers will have relative paths.
================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:42
+ "For symbols' file paths that cannot be resolved to absolute "
+ "paths (i.e. in-memory VFS without absolute paths), "
+ "combine the fallback directory path with file paths to get absolute "
----------------
nit: i.e -> e.g
================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:113
+ !llvm::sys::path::is_absolute(clang::clangd::FallbackDir)) {
+ llvm::errs() << "--prefix-dir must be an absolute path.\n";
+ return 1;
----------------
wrong flag name :-)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42638
More information about the cfe-commits
mailing list