Skip to content

Commit be6550c

Browse files
committed
[Support] Fix some issues in LSP Transport
This fixes: ``` [321/5941] Building CXX object lib\Support\LSP\CMakeFiles\LLVMSupportLSP.dir\Transport.cpp.obj C:\git\llvm-project\llvm\lib\Support\LSP\Transport.cpp(123): warning C4930: 'std::lock_guard<std::mutex> responseHandlersLock(llvm::lsp::MessageHandler::ResponseHandlerTy)': prototyped function not called (was a variable definition intended?) [384/5941] Building CXX object unittests\Support\LSP\CMakeFiles\LLVMSupportLSPTests.dir\Transport.cpp.obj C:\git\llvm-project\llvm\unittests\Support\LSP\Transport.cpp(190): warning C4804: '+=': unsafe use of type 'bool' in operation ```
1 parent c12f08f commit be6550c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Support/LSP/Transport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ bool MessageHandler::onReply(llvm::json::Value Id,
120120
// mapping and erase it.
121121
ResponseHandlerTy ResponseHandler;
122122
{
123-
std::lock_guard<std::mutex> responseHandlersLock(ResponseHandlerTy);
123+
std::lock_guard<std::mutex> responseHandlersLock(ResponseHandlersMutex);
124124
auto It = ResponseHandlers.find(debugString(Id));
125125
if (It != ResponseHandlers.end()) {
126126
ResponseHandler = std::move(It->second);

llvm/unittests/Support/LSP/Transport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ TEST_F(TransportInputTest, OutgoingRequest) {
174174

175175
TEST_F(TransportInputTest, OutgoingRequestJSONParseFailure) {
176176
// Make an outgoing request that expects a failure response.
177-
bool responseCallbackInvoked = false;
177+
unsigned responseCallbackInvoked = 0;
178178
auto callFn = getMessageHandler().outgoingRequest<CompletionList, Position>(
179179
"outgoing-request-json-parse-failure",
180180
[&responseCallbackInvoked](const llvm::json::Value &id,

0 commit comments

Comments
 (0)