[clang-tools-extra] r361798 - [clangd] Rename -run-synchronously to -sync

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Tue May 28 02:20:57 PDT 2019


Author: ibiryukov
Date: Tue May 28 02:20:57 2019
New Revision: 361798

URL: http://llvm.org/viewvc/llvm-project?rev=361798&view=rev
Log:
[clangd] Rename -run-synchronously to -sync

Modified:
    clang-tools-extra/trunk/clangd/test/delimited-input-comment-at-the-end.test
    clang-tools-extra/trunk/clangd/test/input-mirror.test
    clang-tools-extra/trunk/clangd/test/protocol.test
    clang-tools-extra/trunk/clangd/test/spaces-in-delimited-input.test
    clang-tools-extra/trunk/clangd/test/too_large.test
    clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp

Modified: clang-tools-extra/trunk/clangd/test/delimited-input-comment-at-the-end.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/test/delimited-input-comment-at-the-end.test?rev=361798&r1=361797&r2=361798&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/test/delimited-input-comment-at-the-end.test (original)
+++ clang-tools-extra/trunk/clangd/test/delimited-input-comment-at-the-end.test Tue May 28 02:20:57 2019
@@ -1,4 +1,4 @@
-# RUN: clangd -input-style=delimited -run-synchronously -input-mirror-file %t < %s
+# RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s
 # RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
 #
 # RUN: clangd -lit-test -input-mirror-file %t < %s

Modified: clang-tools-extra/trunk/clangd/test/input-mirror.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/test/input-mirror.test?rev=361798&r1=361797&r2=361798&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/test/input-mirror.test (original)
+++ clang-tools-extra/trunk/clangd/test/input-mirror.test Tue May 28 02:20:57 2019
@@ -1,4 +1,4 @@
-# RUN: clangd -pretty -run-synchronously -input-mirror-file %t < %s
+# RUN: clangd -pretty -sync -input-mirror-file %t < %s
 # Note that we have to use '-b' as -input-mirror-file does not have a newline at the end of file.
 # RUN: diff -b %t %s
 # It is absolutely vital that this file has CRLF line endings.

Modified: clang-tools-extra/trunk/clangd/test/protocol.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/test/protocol.test?rev=361798&r1=361797&r2=361798&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/test/protocol.test (original)
+++ clang-tools-extra/trunk/clangd/test/protocol.test Tue May 28 02:20:57 2019
@@ -1,5 +1,5 @@
-# RUN: not clangd -pretty -run-synchronously -enable-test-uri-scheme < %s | FileCheck -strict-whitespace %s
-# RUN: not clangd -pretty -run-synchronously -enable-test-uri-scheme < %s 2>&1 | FileCheck -check-prefix=STDERR %s
+# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s | FileCheck -strict-whitespace %s
+# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s 2>&1 | FileCheck -check-prefix=STDERR %s
 # vim: fileformat=dos
 # It is absolutely vital that this file has CRLF line endings.
 #

Modified: clang-tools-extra/trunk/clangd/test/spaces-in-delimited-input.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/test/spaces-in-delimited-input.test?rev=361798&r1=361797&r2=361798&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/test/spaces-in-delimited-input.test (original)
+++ clang-tools-extra/trunk/clangd/test/spaces-in-delimited-input.test Tue May 28 02:20:57 2019
@@ -1,5 +1,5 @@
-# RUN: clangd -input-style=delimited -run-synchronously < %s 2>&1 | FileCheck %s
-# RUN: clangd -lit-test -run-synchronously < %s 2>&1 | FileCheck %s
+# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s
+# RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s
 #
 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 

Modified: clang-tools-extra/trunk/clangd/test/too_large.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/test/too_large.test?rev=361798&r1=361797&r2=361798&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/test/too_large.test (original)
+++ clang-tools-extra/trunk/clangd/test/too_large.test Tue May 28 02:20:57 2019
@@ -1,4 +1,4 @@
-# RUN: not clangd -run-synchronously < %s 2>&1 | FileCheck -check-prefix=STDERR %s
+# RUN: not clangd -sync < %s 2>&1 | FileCheck -check-prefix=STDERR %s
 # vim: fileformat=dos
 # It is absolutely vital that this file has CRLF line endings.
 #

Modified: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp?rev=361798&r1=361797&r2=361798&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp (original)
+++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp Tue May 28 02:20:57 2019
@@ -96,8 +96,8 @@ static llvm::cl::opt<Logger::Level> LogL
 
 static llvm::cl::opt<bool>
     Test("lit-test",
-         llvm::cl::desc("Abbreviation for -input-style=delimited -pretty "
-                        "-run-synchronously -enable-test-scheme -log=verbose. "
+         llvm::cl::desc("Abbreviation for -input-style=delimited -pretty -sync "
+                        "-enable-test-scheme -log=verbose."
                         "Intended to simplify lit tests."),
          llvm::cl::init(false), llvm::cl::Hidden);
 
@@ -122,10 +122,9 @@ static llvm::cl::opt<int> LimitResults(
                    "0 means no limit. (default=100)"),
     llvm::cl::init(100));
 
-static llvm::cl::opt<bool> RunSynchronously(
-    "run-synchronously",
-    llvm::cl::desc("Parse on main thread. If set, -j is ignored"),
-    llvm::cl::init(false), llvm::cl::Hidden);
+static llvm::cl::opt<bool>
+    Sync("sync", llvm::cl::desc("Parse on main thread. If set, -j is ignored"),
+         llvm::cl::init(false), llvm::cl::Hidden);
 
 static llvm::cl::opt<Path>
     ResourceDir("resource-dir",
@@ -229,10 +228,10 @@ static llvm::cl::opt<std::string> ClangT
         ".clang-tidy files). Only meaningful when -clang-tidy flag is on."),
     llvm::cl::init(""));
 
-static llvm::cl::opt<bool> EnableClangTidy(
-    "clang-tidy",
-    llvm::cl::desc("Enable clang-tidy diagnostics."),
-    llvm::cl::init(true));
+static llvm::cl::opt<bool>
+    EnableClangTidy("clang-tidy",
+                    llvm::cl::desc("Enable clang-tidy diagnostics."),
+                    llvm::cl::init(true));
 
 static llvm::cl::opt<std::string>
     FallbackStyle("fallback-style",
@@ -343,7 +342,7 @@ int main(int argc, char *argv[]) {
       "\n\thttps://clang.llvm.org/extra/clangd.html"
       "\n\thttps://microsoft.github.io/language-server-protocol/");
   if (Test) {
-    RunSynchronously = true;
+    Sync = true;
     InputStyle = JSONStreamStyle::Delimited;
     LogLevel = Logger::Verbose;
     PrettyPrint = true;
@@ -355,15 +354,15 @@ int main(int argc, char *argv[]) {
         "test", "Test scheme for clangd lit tests.");
   }
 
-  if (!RunSynchronously && WorkerThreadsCount == 0) {
+  if (!Sync && WorkerThreadsCount == 0) {
     llvm::errs() << "A number of worker threads cannot be 0. Did you mean to "
-                    "specify -run-synchronously?";
+                    "specify -sync?";
     return 1;
   }
 
-  if (RunSynchronously) {
+  if (Sync) {
     if (WorkerThreadsCount.getNumOccurrences())
-      llvm::errs() << "Ignoring -j because -run-synchronously is set.\n";
+      llvm::errs() << "Ignoring -j because -sync is set.\n";
     WorkerThreadsCount = 0;
   }
   if (FallbackStyle.getNumOccurrences())
@@ -461,7 +460,7 @@ int main(int argc, char *argv[]) {
       if (auto Idx = loadIndex(IndexFile, /*UseDex=*/true))
         Placeholder->reset(std::move(Idx));
     });
-    if (RunSynchronously)
+    if (Sync)
       AsyncIndexLoad.wait();
   }
   Opts.StaticIndex = StaticIdx.get();




More information about the cfe-commits mailing list