[clang-tools-extra] r299854 - [clangd] Relax absolute path checking assertion
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 10 10:03:44 PDT 2017
Author: rnk
Date: Mon Apr 10 12:03:44 2017
New Revision: 299854
URL: http://llvm.org/viewvc/llvm-project?rev=299854&view=rev
Log:
[clangd] Relax absolute path checking assertion
clangd can process absolute paths from systems that don't use the native
path style, so this assertion needs to check both Windows and Posix path
styles.
Fixes PR32596
Modified:
clang-tools-extra/trunk/clangd/ASTManager.cpp
Modified: clang-tools-extra/trunk/clangd/ASTManager.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ASTManager.cpp?rev=299854&r1=299853&r2=299854&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ASTManager.cpp (original)
+++ clang-tools-extra/trunk/clangd/ASTManager.cpp Mon Apr 10 12:03:44 2017
@@ -232,7 +232,9 @@ tooling::CompilationDatabase *
ASTManager::getOrCreateCompilationDatabaseForFile(StringRef File) {
namespace path = llvm::sys::path;
- assert(path::is_absolute(File) && "path must be absolute");
+ assert((path::is_absolute(File, path::Style::posix) ||
+ path::is_absolute(File, path::Style::windows)) &&
+ "path must be absolute");
for (auto Path = path::parent_path(File); !Path.empty();
Path = path::parent_path(Path)) {
More information about the cfe-commits
mailing list