Skip to content

Commit 5587600

Browse files
authored
[ORC] Rename WrapperFunctionResult to WrapperFunctionBuffer. NFCI. (llvm#172633)
Also renames CWrapperFunctionResult to CWrapperFunctionBuffer. These types are used as argument buffers, as well as result buffers. The new name better reflects their purpose, and is consistent with naming in the new ORC runtime (llvm-project/orc-rt).
1 parent b6d06de commit 5587600

35 files changed

+206
-206
lines changed

llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ struct SPSCallSerializationImpl {
2626
using ArgSerialization = shared::SPSArgList<SPSArgTs...>;
2727

2828
template <typename... ArgTs>
29-
Expected<shared::WrapperFunctionResult> serialize(ArgTs &&...Args) {
30-
auto Buffer = shared::WrapperFunctionResult::allocate(
29+
Expected<shared::WrapperFunctionBuffer> serialize(ArgTs &&...Args) {
30+
auto Buffer = shared::WrapperFunctionBuffer::allocate(
3131
ArgSerialization::size(Args...));
3232
shared::SPSOutputBuffer OB(Buffer.data(), Buffer.size());
3333
if (!ArgSerialization::serialize(OB, Args...))
@@ -48,7 +48,7 @@ template <typename SPSSig>
4848
struct SPSCallSerializer : public detail::SPSCallSerialization<SPSSig> {
4949

5050
template <typename RetT>
51-
Expected<RetT> deserialize(shared::WrapperFunctionResult ResultBytes) {
51+
Expected<RetT> deserialize(shared::WrapperFunctionBuffer ResultBytes) {
5252
using RetDeserialization =
5353
typename detail::SPSCallSerialization<SPSSig>::RetSerialization;
5454
shared::SPSInputBuffer IB(ResultBytes.data(), ResultBytes.size());
@@ -66,7 +66,7 @@ struct SPSCallSerializer<void(SPSArgTs...)>
6666
: public detail::SPSCallSerialization<void(SPSArgTs...)> {
6767
template <typename RetT>
6868
std::enable_if_t<std::is_void_v<RetT>, Error>
69-
deserialize(shared::WrapperFunctionResult ResultBytes) {
69+
deserialize(shared::WrapperFunctionBuffer ResultBytes) {
7070
if (!ResultBytes.empty())
7171
return make_error<StringError>("Could not deserialize return value",
7272
inconvertibleErrorCode());

llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ callViaEPC(HandlerFn &&H, ExecutorProcessControl &EPC, Serializer S,
6767
EPC.callWrapperAsync(
6868
Fn.getAddress(),
6969
[S = std::move(S), H = std::forward<HandlerFn>(H)](
70-
shared::WrapperFunctionResult R) mutable {
70+
shared::WrapperFunctionBuffer R) mutable {
7171
if (const char *ErrMsg = R.getOutOfBandError())
7272
H(make_error<StringError>(ErrMsg, inconvertibleErrorCode()));
7373
else

llvm/include/llvm/ExecutionEngine/Orc/Core.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ class ExecutionSession {
13521352
using ErrorReporter = unique_function<void(Error)>;
13531353

13541354
/// Send a result to the remote.
1355-
using SendResultFunction = unique_function<void(shared::WrapperFunctionResult)>;
1355+
using SendResultFunction = unique_function<void(shared::WrapperFunctionBuffer)>;
13561356

13571357
/// An asynchronous wrapper-function callable from the executor via
13581358
/// jit-dispatch.
@@ -1584,7 +1584,7 @@ class ExecutionSession {
15841584
/// The wrapper function should be callable as:
15851585
///
15861586
/// \code{.cpp}
1587-
/// CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);
1587+
/// CWrapperFunctionBuffer fn(uint8_t *Data, uint64_t Size);
15881588
/// \endcode{.cpp}
15891589
void callWrapperAsync(ExecutorAddr WrapperFnAddr,
15901590
ExecutorProcessControl::IncomingWFRHandler OnComplete,
@@ -1614,9 +1614,9 @@ class ExecutionSession {
16141614
/// callable as:
16151615
///
16161616
/// \code{.cpp}
1617-
/// CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);
1617+
/// CWrapperFunctionBuffer fn(uint8_t *Data, uint64_t Size);
16181618
/// \endcode{.cpp}
1619-
shared::WrapperFunctionResult callWrapper(ExecutorAddr WrapperFnAddr,
1619+
shared::WrapperFunctionBuffer callWrapper(ExecutorAddr WrapperFnAddr,
16201620
ArrayRef<char> ArgBuffer) {
16211621
return EPC->callWrapper(WrapperFnAddr, ArgBuffer);
16221622
}

llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,27 @@ class LLVM_ABI ExecutorProcessControl {
3939
friend class ExecutionSession;
4040
public:
4141

42-
/// A handler or incoming WrapperFunctionResults -- either return values from
42+
/// A handler or incoming WrapperFunctionBuffers -- either return values from
4343
/// callWrapper* calls, or incoming JIT-dispatch requests.
4444
///
4545
/// IncomingWFRHandlers are constructible from
46-
/// unique_function<void(shared::WrapperFunctionResult)>s using the
46+
/// unique_function<void(shared::WrapperFunctionBuffer)>s using the
4747
/// runInPlace function or a RunWithDispatch object.
4848
class IncomingWFRHandler {
4949
friend class ExecutorProcessControl;
5050
public:
5151
IncomingWFRHandler() = default;
5252
explicit operator bool() const { return !!H; }
53-
void operator()(shared::WrapperFunctionResult WFR) { H(std::move(WFR)); }
53+
void operator()(shared::WrapperFunctionBuffer WFR) { H(std::move(WFR)); }
5454
private:
5555
template <typename FnT> IncomingWFRHandler(FnT &&Fn)
5656
: H(std::forward<FnT>(Fn)) {}
5757

58-
unique_function<void(shared::WrapperFunctionResult)> H;
58+
unique_function<void(shared::WrapperFunctionBuffer)> H;
5959
};
6060

6161
/// Constructs an IncomingWFRHandler from a function object that is callable
62-
/// as void(shared::WrapperFunctionResult). The function object will be called
62+
/// as void(shared::WrapperFunctionBuffer). The function object will be called
6363
/// directly. This should be used with care as it may block listener threads
6464
/// in remote EPCs. It is only suitable for simple tasks (e.g. setting a
6565
/// future), or for performing some quick analysis before dispatching "real"
@@ -85,7 +85,7 @@ class LLVM_ABI ExecutorProcessControl {
8585
IncomingWFRHandler operator()(FnT &&Fn) {
8686
return IncomingWFRHandler(
8787
[&D = this->D, Fn = std::move(Fn)]
88-
(shared::WrapperFunctionResult WFR) mutable {
88+
(shared::WrapperFunctionBuffer WFR) mutable {
8989
D.dispatch(
9090
makeGenericNamedTask(
9191
[Fn = std::move(Fn), WFR = std::move(WFR)]() mutable {
@@ -219,7 +219,7 @@ class LLVM_ABI ExecutorProcessControl {
219219
/// The wrapper function should be callable as:
220220
///
221221
/// \code{.cpp}
222-
/// CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);
222+
/// CWrapperFunctionBuffer fn(uint8_t *Data, uint64_t Size);
223223
/// \endcode{.cpp}
224224
virtual void callWrapperAsync(ExecutorAddr WrapperFnAddr,
225225
IncomingWFRHandler OnComplete,
@@ -247,15 +247,15 @@ class LLVM_ABI ExecutorProcessControl {
247247
/// callable as:
248248
///
249249
/// \code{.cpp}
250-
/// CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);
250+
/// CWrapperFunctionBuffer fn(uint8_t *Data, uint64_t Size);
251251
/// \endcode{.cpp}
252-
shared::WrapperFunctionResult callWrapper(ExecutorAddr WrapperFnAddr,
252+
shared::WrapperFunctionBuffer callWrapper(ExecutorAddr WrapperFnAddr,
253253
ArrayRef<char> ArgBuffer) {
254-
std::promise<shared::WrapperFunctionResult> RP;
254+
std::promise<shared::WrapperFunctionBuffer> RP;
255255
auto RF = RP.get_future();
256256
callWrapperAsync(
257257
RunInPlace(), WrapperFnAddr,
258-
[&](shared::WrapperFunctionResult R) {
258+
[&](shared::WrapperFunctionBuffer R) {
259259
RP.set_value(std::move(R));
260260
}, ArgBuffer);
261261
return RF.get();

llvm/include/llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class LLVM_ABI SelfExecutorProcessControl : public ExecutorProcessControl,
5454
Error disconnect() override;
5555

5656
private:
57-
static shared::CWrapperFunctionResult
57+
static shared::CWrapperFunctionBuffer
5858
jitDispatchViaWrapperFunctionManager(void *Ctx, const void *FnTag,
5959
const char *Data, size_t Size);
6060

0 commit comments

Comments
 (0)