[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

Michael Spencer via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 13:11:06 PDT 2024


================
@@ -0,0 +1,66 @@
+//===------------------------ SocketMsgSupport.cpp ------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/raw_socket_stream.h"
+
+#include <memory>
+#include <string>
+
+using namespace llvm;
+
+namespace clang::tooling::cc1modbuildd {
+
+Expected<std::unique_ptr<raw_socket_stream>>
+connectToSocket(StringRef SocketPath) {
+
+  Expected<std::unique_ptr<raw_socket_stream>> MaybeClient =
+      raw_socket_stream::createConnectedUnix(SocketPath);
+  if (!MaybeClient)
+    return MaybeClient.takeError();
+
+  return std::move(*MaybeClient);
+}
----------------
Bigcheese wrote:

With the adoption of `raw_socket_stream` it looks like this function isn't needed now.

https://github.com/llvm/llvm-project/pull/67562


More information about the llvm-commits mailing list