[libc-commits] [PATCH] D147180: [libc] Add LIBC_INLINE macro to RPC implementation

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 29 13:25:35 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: sivachandra, michaelrj, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

These were required by the llvmlibc linter.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147180

Files:
  libc/src/__support/RPC/rpc.h


Index: libc/src/__support/RPC/rpc.h
===================================================================
--- libc/src/__support/RPC/rpc.h
+++ libc/src/__support/RPC/rpc.h
@@ -43,12 +43,16 @@
 /// server. The process contains an inbox and an outbox used for signaling
 /// ownership of the shared buffer.
 struct Process {
+  LIBC_INLINE Process(const Process &) = default;
+  LIBC_INLINE Process &operator=(const Process &) = default;
+  LIBC_INLINE ~Process() = default;
+
   cpp::Atomic<uint32_t> *inbox;
   cpp::Atomic<uint32_t> *outbox;
   Buffer *buffer;
 
   /// Initialize the communication channels.
-  void reset(void *inbox, void *outbox, void *buffer) {
+  LIBC_INLINE void reset(void *inbox, void *outbox, void *buffer) {
     *this = {
         reinterpret_cast<cpp::Atomic<uint32_t> *>(inbox),
         reinterpret_cast<cpp::Atomic<uint32_t> *>(outbox),
@@ -59,11 +63,19 @@
 
 /// The RPC client used to make requests to the server.
 struct Client : public Process {
+  LIBC_INLINE Client(const Client &) = default;
+  LIBC_INLINE Client &operator=(const Client &) = default;
+  LIBC_INLINE ~Client() = default;
+
   template <typename F, typename U> void run(F fill, U use);
 };
 
 /// The RPC server used to respond to the client.
 struct Server : public Process {
+  LIBC_INLINE Server(const Server &) = default;
+  LIBC_INLINE Server &operator=(const Server &) = default;
+  LIBC_INLINE ~Server() = default;
+
   template <typename W, typename C> bool handle(W work, C clean);
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147180.509467.patch
Type: text/x-patch
Size: 1500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230329/8bc34824/attachment.bin>


More information about the libc-commits mailing list