[PATCH] D64789: [clangd] Handle windows line endings in QueryDriver

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 06:13:44 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366320: [clangd] Handle windows line endings in QueryDriver (authored by kadircet, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64789?vs=210054&id=210304#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64789/new/

https://reviews.llvm.org/D64789

Files:
  clang-tools-extra/trunk/clangd/QueryDriverDatabase.cpp
  clang-tools-extra/trunk/clangd/test/system-include-extractor.test


Index: clang-tools-extra/trunk/clangd/QueryDriverDatabase.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/QueryDriverDatabase.cpp
+++ clang-tools-extra/trunk/clangd/QueryDriverDatabase.cpp
@@ -63,7 +63,9 @@
   llvm::SmallVector<llvm::StringRef, 8> Lines;
   Output.split(Lines, '\n', /*MaxSplit=*/-1, /*KeepEmpty=*/false);
 
-  auto StartIt = std::find(Lines.begin(), Lines.end(), SIS);
+  auto StartIt =
+      std::find_if(Lines.begin(), Lines.end(),
+                   [](llvm::StringRef Line) { return Line.trim() == SIS; });
   if (StartIt == Lines.end()) {
     elog("System include extraction: start marker not found: {0}", Output);
     return {};
Index: clang-tools-extra/trunk/clangd/test/system-include-extractor.test
===================================================================
--- clang-tools-extra/trunk/clangd/test/system-include-extractor.test
+++ clang-tools-extra/trunk/clangd/test/system-include-extractor.test
@@ -5,7 +5,7 @@
 # RUN: echo '#!/bin/bash' >> %t.dir/my_driver.sh
 # RUN: echo '[ "$0" = "%t.dir/my_driver.sh" ] || exit' >> %t.dir/my_driver.sh
 # RUN: echo 'echo line to ignore >&2' >> %t.dir/my_driver.sh
-# RUN: echo 'echo \#include \<...\> search starts here: >&2' >> %t.dir/my_driver.sh
+# RUN: echo 'echo -e "#include <...> search starts here:\r" >&2' >> %t.dir/my_driver.sh
 # RUN: echo 'echo %t.dir/my/dir/ >&2' >> %t.dir/my_driver.sh
 # RUN: echo 'echo %t.dir/my/dir2/ >&2' >> %t.dir/my_driver.sh
 # RUN: echo 'echo End of search list. >&2' >> %t.dir/my_driver.sh


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64789.210304.patch
Type: text/x-patch
Size: 1570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190717/3a86a101/attachment-0001.bin>


More information about the cfe-commits mailing list