projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60a8edf
)
[clangd] Explicitly fail if the file passed to --check is not valid.
author
Haojian Wu
<hokein.wu@gmail.com>
Thu, 17 Jun 2021 12:33:24 +0000
(14:33 +0200)
committer
Haojian Wu
<hokein.wu@gmail.com>
Thu, 17 Jun 2021 14:41:06 +0000
(16:41 +0200)
Differential Revision: https://reviews.llvm.org/D104455
clang-tools-extra/clangd/tool/ClangdMain.cpp
patch
|
blob
|
history
diff --git
a/clang-tools-extra/clangd/tool/ClangdMain.cpp
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index
0f9e5c8
..
6d70a9c
100644
(file)
--- a/
clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/
clang-tools-extra/clangd/tool/ClangdMain.cpp
@@
-909,7
+909,11
@@
clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var
if (CheckFile.getNumOccurrences()) {
llvm::SmallString<256> Path;
- llvm::sys::fs::real_path(CheckFile, Path, /*expand_tilde=*/true);
+ if (auto Error =
+ llvm::sys::fs::real_path(CheckFile, Path, /*expand_tilde=*/true)) {
+ elog("Failed to resolve path {0}: {1}", CheckFile, Error.message());
+ return 1;
+ }
log("Entering check mode (no LSP server)");
uint32_t Begin = 0, End = std::numeric_limits<uint32_t>::max();
if (!CheckFileLines.empty()) {