[llvm-branch-commits] [clang-tools-extra-branch] r367571 - Merging r366545:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 1 07:47:07 PDT 2019


Author: hans
Date: Thu Aug  1 07:47:07 2019
New Revision: 367571

URL: http://llvm.org/viewvc/llvm-project?rev=367571&view=rev
Log:
Merging r366545:
------------------------------------------------------------------------
r366545 | kadircet | 2019-07-19 11:08:22 +0200 (Fri, 19 Jul 2019) | 17 lines

[clangd] Handle windows line endings in QueryDriver

Summary:
The previous patch did not fix the end mark. D64789
fixes second case of https://github.com/clangd/clangd/issues/93

Patch by @lh123 !

Reviewers: sammccall, kadircet

Reviewed By: kadircet

Subscribers: MaskRay, ilya-biryukov, jkorous, arphaman, cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D64970
------------------------------------------------------------------------

Modified:
    clang-tools-extra/branches/release_90/   (props changed)
    clang-tools-extra/branches/release_90/clangd/QueryDriverDatabase.cpp
    clang-tools-extra/branches/release_90/clangd/test/system-include-extractor.test

Propchange: clang-tools-extra/branches/release_90/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  1 07:47:07 2019
@@ -1 +1 @@
-/clang-tools-extra/trunk:366443,366451,366455,366559,366687,366811,366880,366900,366991-366992,367112
+/clang-tools-extra/trunk:366443,366451,366455,366545,366559,366687,366811,366880,366900,366991-366992,367112

Modified: clang-tools-extra/branches/release_90/clangd/QueryDriverDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/branches/release_90/clangd/QueryDriverDatabase.cpp?rev=367571&r1=367570&r2=367571&view=diff
==============================================================================
--- clang-tools-extra/branches/release_90/clangd/QueryDriverDatabase.cpp (original)
+++ clang-tools-extra/branches/release_90/clangd/QueryDriverDatabase.cpp Thu Aug  1 07:47:07 2019
@@ -59,7 +59,7 @@ namespace {
 std::vector<std::string> parseDriverOutput(llvm::StringRef Output) {
   std::vector<std::string> SystemIncludes;
   const char SIS[] = "#include <...> search starts here:";
-  constexpr char const *SIE = "End of search list.";
+  const char SIE[] = "End of search list.";
   llvm::SmallVector<llvm::StringRef, 8> Lines;
   Output.split(Lines, '\n', /*MaxSplit=*/-1, /*KeepEmpty=*/false);
 
@@ -70,7 +70,9 @@ std::vector<std::string> parseDriverOutp
     return {};
   }
   ++StartIt;
-  const auto EndIt = std::find(StartIt, Lines.end(), SIE);
+  const auto EndIt =
+      llvm::find_if(llvm::make_range(StartIt, Lines.end()),
+                    [SIE](llvm::StringRef Line) { return Line.trim() == SIE; });
   if (EndIt == Lines.end()) {
     elog("System include extraction: end marker missing: {0}", Output);
     return {};

Modified: clang-tools-extra/branches/release_90/clangd/test/system-include-extractor.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/branches/release_90/clangd/test/system-include-extractor.test?rev=367571&r1=367570&r2=367571&view=diff
==============================================================================
--- clang-tools-extra/branches/release_90/clangd/test/system-include-extractor.test (original)
+++ clang-tools-extra/branches/release_90/clangd/test/system-include-extractor.test Thu Aug  1 07:47:07 2019
@@ -8,7 +8,7 @@
 # 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
+# RUN: echo 'echo -e "End of search list.\r" >&2' >> %t.dir/my_driver.sh
 # RUN: chmod +x %t.dir/my_driver.sh
 
 # Create header files my/dir/a.h and my/dir2/b.h




More information about the llvm-branch-commits mailing list