[libc] Rename rpc::Status to rpc::RPCStatus to reduce conflicts (#190239)
Summary: `Status` is unfortunately heavily overloaded in practice. Things like X11 define it as a macro. Best to just remove that possibility entirely.
This commit is contained in:
parent
1474e3e4f4
commit
b2d3a6574c
@ -156,7 +156,7 @@ bool EnqueueDeferred(FnTy &&fn, Cookie cookie, Args &&...args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <std::uint32_t NumLanes>
|
template <std::uint32_t NumLanes>
|
||||||
rpc::Status HandleOpcodesImpl(rpc::Server::Port &port) {
|
rpc::RPCStatus HandleOpcodesImpl(rpc::Server::Port &port) {
|
||||||
switch (port.get_opcode()) {
|
switch (port.get_opcode()) {
|
||||||
case BeginExternalListOutput_Opcode:
|
case BeginExternalListOutput_Opcode:
|
||||||
rpc::invoke<NumLanes>(port,
|
rpc::invoke<NumLanes>(port,
|
||||||
|
|||||||
@ -41,7 +41,7 @@ namespace rpc {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Generic codes that can be used when implementing the server.
|
/// Generic codes that can be used when implementing the server.
|
||||||
enum Status {
|
enum RPCStatus {
|
||||||
RPC_SUCCESS = 0x0,
|
RPC_SUCCESS = 0x0,
|
||||||
RPC_ERROR = 0x1000,
|
RPC_ERROR = 0x1000,
|
||||||
RPC_UNHANDLED_OPCODE = 0x1001,
|
RPC_UNHANDLED_OPCODE = 0x1001,
|
||||||
|
|||||||
@ -311,7 +311,7 @@ LIBC_INLINE static void handle_printf(rpc::Server::Port &port,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <uint32_t num_lanes>
|
template <uint32_t num_lanes>
|
||||||
LIBC_INLINE static rpc::Status handle_port_impl(rpc::Server::Port &port) {
|
LIBC_INLINE static rpc::RPCStatus handle_port_impl(rpc::Server::Port &port) {
|
||||||
TempStorage temp_storage;
|
TempStorage temp_storage;
|
||||||
|
|
||||||
switch (port.get_opcode()) {
|
switch (port.get_opcode()) {
|
||||||
@ -586,8 +586,8 @@ namespace LIBC_NAMESPACE_DECL {
|
|||||||
namespace rpc {
|
namespace rpc {
|
||||||
|
|
||||||
// Handles any opcode generated from the 'libc' client code.
|
// Handles any opcode generated from the 'libc' client code.
|
||||||
LIBC_INLINE ::rpc::Status handle_libc_opcodes(::rpc::Server::Port &port,
|
LIBC_INLINE ::rpc::RPCStatus handle_libc_opcodes(::rpc::Server::Port &port,
|
||||||
uint32_t num_lanes) {
|
uint32_t num_lanes) {
|
||||||
switch (num_lanes) {
|
switch (num_lanes) {
|
||||||
case 1:
|
case 1:
|
||||||
return internal::handle_port_impl<1>(port);
|
return internal::handle_port_impl<1>(port);
|
||||||
|
|||||||
@ -26,8 +26,8 @@ using namespace omp;
|
|||||||
using namespace target;
|
using namespace target;
|
||||||
|
|
||||||
template <uint32_t NumLanes>
|
template <uint32_t NumLanes>
|
||||||
rpc::Status handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
|
rpc::RPCStatus handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
|
||||||
rpc::Server::Port &Port) {
|
rpc::Server::Port &Port) {
|
||||||
|
|
||||||
switch (Port.get_opcode()) {
|
switch (Port.get_opcode()) {
|
||||||
case LIBC_MALLOC: {
|
case LIBC_MALLOC: {
|
||||||
@ -74,9 +74,9 @@ rpc::Status handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
|
|||||||
return rpc::RPC_SUCCESS;
|
return rpc::RPC_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static rpc::Status handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
|
static rpc::RPCStatus handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
|
||||||
rpc::Server::Port &Port,
|
rpc::Server::Port &Port,
|
||||||
uint32_t NumLanes) {
|
uint32_t NumLanes) {
|
||||||
if (NumLanes == 1)
|
if (NumLanes == 1)
|
||||||
return handleOffloadOpcodes<1>(Device, Port);
|
return handleOffloadOpcodes<1>(Device, Port);
|
||||||
else if (NumLanes == 32)
|
else if (NumLanes == 32)
|
||||||
@ -87,7 +87,7 @@ static rpc::Status handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
|
|||||||
return rpc::RPC_ERROR;
|
return rpc::RPC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static rpc::Status
|
static rpc::RPCStatus
|
||||||
runServer(plugin::GenericDeviceTy &Device, void *Buffer,
|
runServer(plugin::GenericDeviceTy &Device, void *Buffer,
|
||||||
llvm::SmallSetVector<RPCServerTy::RPCServerCallbackTy, 0> &Callbacks,
|
llvm::SmallSetVector<RPCServerTy::RPCServerCallbackTy, 0> &Callbacks,
|
||||||
bool &ClientInUse) {
|
bool &ClientInUse) {
|
||||||
@ -100,11 +100,11 @@ runServer(plugin::GenericDeviceTy &Device, void *Buffer,
|
|||||||
return rpc::RPC_SUCCESS;
|
return rpc::RPC_SUCCESS;
|
||||||
ClientInUse = true;
|
ClientInUse = true;
|
||||||
|
|
||||||
rpc::Status Status = rpc::RPC_UNHANDLED_OPCODE;
|
rpc::RPCStatus Status = rpc::RPC_UNHANDLED_OPCODE;
|
||||||
const uint32_t NumLanes = Device.getRPCNumLanes();
|
const uint32_t NumLanes = Device.getRPCNumLanes();
|
||||||
|
|
||||||
for (RPCServerTy::RPCServerCallbackTy Callback : Callbacks) {
|
for (RPCServerTy::RPCServerCallbackTy Callback : Callbacks) {
|
||||||
Status = static_cast<rpc::Status>(Callback(&*Port, NumLanes));
|
Status = static_cast<rpc::RPCStatus>(Callback(&*Port, NumLanes));
|
||||||
if (Status != rpc::RPC_UNHANDLED_OPCODE)
|
if (Status != rpc::RPC_UNHANDLED_OPCODE)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ runServer(plugin::GenericDeviceTy &Device, void *Buffer,
|
|||||||
|
|
||||||
#ifdef OFFLOAD_HAS_FLANG_RT
|
#ifdef OFFLOAD_HAS_FLANG_RT
|
||||||
if (Status == rpc::RPC_UNHANDLED_OPCODE)
|
if (Status == rpc::RPC_UNHANDLED_OPCODE)
|
||||||
Status = static_cast<rpc::Status>(
|
Status = static_cast<rpc::RPCStatus>(
|
||||||
Fortran::runtime::io::IONAME(HandleRPCOpcodes)(&*Port, NumLanes));
|
Fortran::runtime::io::IONAME(HandleRPCOpcodes)(&*Port, NumLanes));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user