This is an archive of the discontinued LLVM Phabricator instance.

[libc] Simplify RPC send and recv callback interface
Needs ReviewPublic

Authored by jhuber6 on May 13 2023, 2:26 PM.

Details

Summary

We use lambda callbacks as the main way to interface with the send and
recv functions at the core of the RPC interface. This provided the
user with a pointer to the underlying data buffer to use. However, this
was somewhat annoying to use as it required constant bit casts. This
patch uses template magic to infer the desired type and automatically
cast to what the user passes in. Some static checks ensure that this is
actually legal. This will allow for functions to more easily describe
structs that match the expected argument format.

Diff Detail

Event Timeline

jhuber6 created this revision.May 13 2023, 2:26 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 13 2023, 2:26 PM
jhuber6 requested review of this revision.May 13 2023, 2:26 PM

LGTM

libc/src/__support/CPP/type_traits.h
60

nit: I think these should go right after is_pointer