[libc-commits] [libc] [llvm] [libc] Support array tags in the RPC dispatch helpers (PR #181395)

Shilei Tian via libc-commits libc-commits at lists.llvm.org
Mon Feb 16 19:55:22 PST 2026


================
@@ -106,6 +106,25 @@ template <typename T, typename... Args>
 RPC_ATTRS constexpr bool is_trivially_constructible_v =
     is_trivially_constructible<T>::value;
 
+/// Tag type to indicate an array of elements being passed through RPC.
+template <typename T> struct array_ref {
+  T *data;
----------------
shiltian wrote:

I'd make this `const T *data` such that users don't have to do `array_ref<const T>`, since it can't and shouldn't be modified anyway. It might be even worth making it a `const T * const Data`. However, do you plan to use the same tag type for return value as well? In that case, maybe some types/traits for readonly and writable variants?

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


More information about the libc-commits mailing list