[clangd/index/remote]NFC: Adapt code to newer grpc/protobuf versions
authorMatthias Braun <matze@braunis.de>
Wed, 22 Feb 2023 23:25:11 +0000 (15:25 -0800)
committerMatthias Braun <matze@braunis.de>
Thu, 23 Feb 2023 19:26:41 +0000 (11:26 -0800)
It seems newer grpc / protobuf versions renamed
`Status::error_message()` and `Status::error_code()` to `message()` and
`code()` to prepare for replacement with `absl::Status` with the same
names.

As far as I can tell the new names are already available in the
grpc-1.36 version mentioned in the `README` file.

Differential Revision: https://reviews.llvm.org/D144599

clang-tools-extra/clangd/index/remote/monitor/Monitor.cpp

index 96451f7..9a58b58 100644 (file)
@@ -67,8 +67,9 @@ int main(int argc, char *argv[]) {
       google::protobuf::util::MessageToJsonString(Response, &Output, Options);
   if (!JsonStatus.ok()) {
     clang::clangd::elog("Can not convert response ({0}) to JSON ({1}): {2}\n",
-                        Response.DebugString(), JsonStatus.error_code(),
-                        JsonStatus.error_message().as_string());
+                        Response.DebugString(),
+                        static_cast<int>(JsonStatus.code()),
+                        JsonStatus.message().as_string());
     return -1;
   }
   llvm::outs() << Output;