[clang-tools-extra] r371422 - [clangd] Attempt to fix failing Windows buildbots.

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 10:03:49 PDT 2019


Author: ibiryukov
Date: Mon Sep  9 10:03:49 2019
New Revision: 371422

URL: http://llvm.org/viewvc/llvm-project?rev=371422&view=rev
Log:
[clangd] Attempt to fix failing Windows buildbots.

The assertion is failing on Windows, probably because path separator is different.

For the failure see:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/28072/steps/test/logs/stdio

Modified:
    clang-tools-extra/trunk/clangd/index/CanonicalIncludes.cpp

Modified: clang-tools-extra/trunk/clangd/index/CanonicalIncludes.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/CanonicalIncludes.cpp?rev=371422&r1=371421&r2=371422&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/CanonicalIncludes.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/CanonicalIncludes.cpp Mon Sep  9 10:03:49 2019
@@ -47,6 +47,7 @@ CanonicalIncludes::mapHeader(llvm::Strin
 
   int Components = 1;
 
+  // FIXME: check that this works on Windows and add tests.
   for (auto It = llvm::sys::path::rbegin(Header),
             End = llvm::sys::path::rend(Header);
        It != End && Components <= MaxSuffixComponents; ++It, ++Components) {
@@ -759,12 +760,14 @@ void CanonicalIncludes::addSystemHeaders
   });
   // Check MaxSuffixComponents constant is correct.
   assert(llvm::all_of(SystemHeaderMap->keys(), [](llvm::StringRef Path) {
-    return std::distance(llvm::sys::path::begin(Path),
-                         llvm::sys::path::end(Path)) <= MaxSuffixComponents;
+    return std::distance(
+               llvm::sys::path::begin(Path, llvm::sys::path::Style::posix),
+               llvm::sys::path::end(Path)) <= MaxSuffixComponents;
   }));
   // ... and precise.
   assert(llvm::find_if(SystemHeaderMap->keys(), [](llvm::StringRef Path) {
-           return std::distance(llvm::sys::path::begin(Path),
+           return std::distance(llvm::sys::path::begin(
+                                    Path, llvm::sys::path::Style::posix),
                                 llvm::sys::path::end(Path)) ==
                   MaxSuffixComponents;
          }) != SystemHeaderMap->keys().end());




More information about the cfe-commits mailing list