[llvm] [orc-rt] Mark ControllerAccess constructor as noexcept. (PR #229663)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 22:50:42 PDT 2026


https://github.com/lhames created https://github.com/llvm/llvm-project/pull/229663

ControllerAccess construction should not throw. Add the noexcept specifier to the ControllerAccess constructor, in-tree subclass constructors (InProcessControllerAccess and SocketSimpleRemoteCA) and to the operations they depend upon.

>From f642f035327087b6af70325072eed844b3f09aa0 Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Wed, 7 Oct 2026 16:42:11 +1100
Subject: [PATCH] [orc-rt] Mark ControllerAccess constructor as noexcept.

ControllerAccess construction should not throw. Add the noexcept
specifier to the ControllerAccess constructor, in-tree subclass
constructors (InProcessControllerAccess and SocketSimpleRemoteCA) and to
the operations they depend upon.
---
 orc-rt/include/orc-rt/bedrock/InProcessControllerAccess.h | 6 +++---
 orc-rt/include/orc-rt/bedrock/Session.h                   | 2 +-
 orc-rt/lib/bedrock/InProcessControllerAccess.cpp          | 8 ++++----
 .../bedrock/sys/posix/sps/SimpleRemoteCAOverSocket.cpp    | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/orc-rt/include/orc-rt/bedrock/InProcessControllerAccess.h b/orc-rt/include/orc-rt/bedrock/InProcessControllerAccess.h
index 52626c893b6b6c..558270a2528de4 100644
--- a/orc-rt/include/orc-rt/bedrock/InProcessControllerAccess.h
+++ b/orc-rt/include/orc-rt/bedrock/InProcessControllerAccess.h
@@ -33,8 +33,8 @@ class InProcessControllerAccess : public Session::ControllerAccess {
   /// and InProcessControllerAccess without relying on anything but C ABI.
   /// Must be kept in-sync with the corresponding struct in InProcessEPC.
   struct Connection {
-    void (*Retain)(Connection *C) = nullptr;
-    void (*Release)(Connection *C) = nullptr;
+    void (*Retain)(Connection *C) noexcept = nullptr;
+    void (*Release)(Connection *C) noexcept = nullptr;
     void (*Disconnect)(Connection *C) = nullptr;
     int (*EnterMessageScope)(Connection *C) = nullptr;
     void (*LeaveMessageScope)(Connection *C) = nullptr;
@@ -94,7 +94,7 @@ class InProcessControllerAccess : public Session::ControllerAccess {
                                                BootstrapInfoAccess *BCA)>;
 
   /// Create an InProcessControllerAccess instance.
-  InProcessControllerAccess(Session &S, OnConnectFn OnConnect)
+  InProcessControllerAccess(Session &S, OnConnectFn OnConnect) noexcept
       : Session::ControllerAccess(S), OnConnect(std::move(OnConnect)) {}
 
   InProcessControllerAccess(const InProcessControllerAccess &) = delete;
diff --git a/orc-rt/include/orc-rt/bedrock/Session.h b/orc-rt/include/orc-rt/bedrock/Session.h
index fbcd2da13f90e8..d0bf1c1c7b66ea 100644
--- a/orc-rt/include/orc-rt/bedrock/Session.h
+++ b/orc-rt/include/orc-rt/bedrock/Session.h
@@ -140,7 +140,7 @@ class Session {
       OnControllerCallReturnFn Wrapped;
     };
 
-    ControllerAccess(Session &S) : S(S) {}
+    ControllerAccess(Session &S) noexcept : S(S) {}
 
     /// Initiate connection with controller.
     ///
diff --git a/orc-rt/lib/bedrock/InProcessControllerAccess.cpp b/orc-rt/lib/bedrock/InProcessControllerAccess.cpp
index d419e11b0d6040..5192b2a4f4cf22 100644
--- a/orc-rt/lib/bedrock/InProcessControllerAccess.cpp
+++ b/orc-rt/lib/bedrock/InProcessControllerAccess.cpp
@@ -32,22 +32,22 @@ struct InProcessControllerAccess::ConnectionImpl : public Connection {
   }
 
 private:
-  void retain() {
+  void retain() noexcept {
     std::scoped_lock<std::mutex> Lock(M);
     ++RefCount;
   }
 
-  static void retainEntry(Connection *C) {
+  static void retainEntry(Connection *C) noexcept {
     static_cast<ConnectionImpl *>(C)->retain();
   }
 
-  int release() {
+  int release() noexcept {
     std::scoped_lock<std::mutex> Lock(M);
     --RefCount;
     return RefCount == 0;
   }
 
-  static void releaseEntry(Connection *C) {
+  static void releaseEntry(Connection *C) noexcept {
     if (static_cast<ConnectionImpl *>(C)->release())
       delete static_cast<ConnectionImpl *>(C);
   }
diff --git a/orc-rt/lib/bedrock/sys/posix/sps/SimpleRemoteCAOverSocket.cpp b/orc-rt/lib/bedrock/sys/posix/sps/SimpleRemoteCAOverSocket.cpp
index 4a8ee4e474bcf7..db2a6b248f4a7a 100644
--- a/orc-rt/lib/bedrock/sys/posix/sps/SimpleRemoteCAOverSocket.cpp
+++ b/orc-rt/lib/bedrock/sys/posix/sps/SimpleRemoteCAOverSocket.cpp
@@ -102,7 +102,7 @@ class SocketSimpleRemoteCA : public SimpleRemoteCA {
   };
 
   SocketSimpleRemoteCA(Session &S, SocketHandle Sock, SocketHandle WakeRead,
-                       SocketHandle WakeWrite)
+                       SocketHandle WakeWrite) noexcept
       : SimpleRemoteCA(S), Sock(std::move(Sock)), WakeRead(std::move(WakeRead)),
         WakeWrite(std::move(WakeWrite)) {}
 



More information about the llvm-commits mailing list