omtcyfz created this revision. omtcyfz added a reviewer: ioeric. omtcyfz added a project: clang-tools-extra. Herald added subscribers: cfe-commits, jkorous-apple, ilya-biryukov.
- Address a FIXME by warning the user that both -run-synchronously and -j X are passed. - Fix a comment to suppress clang-tidy warning by passing the correct argument name. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43671 Files: clangd/Context.cpp clangd/tool/ClangdMain.cpp Index: clangd/tool/ClangdMain.cpp =================================================================== --- clangd/tool/ClangdMain.cpp +++ clangd/tool/ClangdMain.cpp @@ -149,10 +149,14 @@ return 1; } - // Ignore -j option if -run-synchonously is used. - // FIXME: a warning should be shown here. - if (RunSynchronously) + if (RunSynchronously) { + if (WorkerThreadsCount != 0) { + llvm::errs() + << "-run-synchronously was used with a number of worker " + "threads greater than zero. Clangd will run synchronously."; + } WorkerThreadsCount = 0; + } // Validate command line arguments. llvm::Optional<llvm::raw_fd_ostream> InputMirrorStream; Index: clangd/Context.cpp =================================================================== --- clangd/Context.cpp +++ clangd/Context.cpp @@ -13,7 +13,7 @@ namespace clang { namespace clangd { -Context Context::empty() { return Context(/*Data=*/nullptr); } +Context Context::empty() { return Context(/*DataPtr=*/nullptr); } Context::Context(std::shared_ptr<const Data> DataPtr) : DataPtr(std::move(DataPtr)) {}
Index: clangd/tool/ClangdMain.cpp =================================================================== --- clangd/tool/ClangdMain.cpp +++ clangd/tool/ClangdMain.cpp @@ -149,10 +149,14 @@ return 1; } - // Ignore -j option if -run-synchonously is used. - // FIXME: a warning should be shown here. - if (RunSynchronously) + if (RunSynchronously) { + if (WorkerThreadsCount != 0) { + llvm::errs() + << "-run-synchronously was used with a number of worker " + "threads greater than zero. Clangd will run synchronously."; + } WorkerThreadsCount = 0; + } // Validate command line arguments. llvm::Optional<llvm::raw_fd_ostream> InputMirrorStream; Index: clangd/Context.cpp =================================================================== --- clangd/Context.cpp +++ clangd/Context.cpp @@ -13,7 +13,7 @@ namespace clang { namespace clangd { -Context Context::empty() { return Context(/*Data=*/nullptr); } +Context Context::empty() { return Context(/*DataPtr=*/nullptr); } Context::Context(std::shared_ptr<const Data> DataPtr) : DataPtr(std::move(DataPtr)) {}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits