[ORC] Use uint8_t rather than char for RPC wrapper-function calls.

This partially reverts 838490de7e, which broke some Solaris bots. Apparently
Solaris defines int8_t as char rather than signed char, which made the
SerializationTypeName<char> specialization a redefinition.

This partial revert isolates use of uint8_t buffers to ORC-RPC handling of
wrapper functions only. The TargetProcessControl::runWrapper method will
continue to use char buffers.
This commit is contained in:
Lang Hames 2021-06-18 21:42:43 +10:00
parent 7ddd15cd5d
commit cbfb12469b
3 changed files with 10 additions and 11 deletions

View File

@ -362,8 +362,10 @@ public:
<< formatv("{0:x16}", WrapperFnAddr) << " with "
<< formatv("{0:x16}", ArgBuffer.size()) << " argument buffer\n";
});
auto Result =
EP.template callB<orcrpctpc::RunWrapper>(WrapperFnAddr, ArgBuffer);
auto Result = EP.template callB<orcrpctpc::RunWrapper>(
WrapperFnAddr,
ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(ArgBuffer.data()),
ArgBuffer.size()));
return Result;
}

View File

@ -58,11 +58,6 @@ public:
static const char *getName() { return "void"; }
};
template <> class SerializationTypeName<char> {
public:
static const char *getName() { return "char"; }
};
template <> class SerializationTypeName<int8_t> {
public:
static const char *getName() { return "int8_t"; }

View File

@ -358,7 +358,7 @@ public:
class RunWrapper
: public shared::RPCFunction<RunWrapper,
shared::WrapperFunctionResult(
JITTargetAddress, std::vector<char>)> {
JITTargetAddress, std::vector<uint8_t>)> {
public:
static const char *getName() { return "RunWrapper"; }
};
@ -580,12 +580,14 @@ private:
ProgramNameOverride);
}
shared::WrapperFunctionResult runWrapper(JITTargetAddress WrapperFnAddr,
const std::vector<char> &ArgBuffer) {
shared::WrapperFunctionResult
runWrapper(JITTargetAddress WrapperFnAddr,
const std::vector<uint8_t> &ArgBuffer) {
using WrapperFnTy = shared::detail::CWrapperFunctionResult (*)(
const char *Data, uint64_t Size);
auto *WrapperFn = jitTargetAddressToFunction<WrapperFnTy>(WrapperFnAddr);
return WrapperFn(ArgBuffer.data(), ArgBuffer.size());
return WrapperFn(reinterpret_cast<const char *>(ArgBuffer.data()),
ArgBuffer.size());
}
void closeConnection() { Finished = true; }