Skip to content

Conversation

lhames
Copy link
Contributor

@lhames lhames commented Oct 6, 2025

WrapperFunction::handleWithAsyncMethod can be used to wrap asynchronous methods (void methods whose first arguments are Return callbacks) for use with WrapperFunction::handle.

WrapperFunction::handleWithSyncMethod can be used to wrap regular (non-asynchronous) methods for use with WrapperFunction::handle.

Both variants return function objects that take a Return callback as their first argument, and an ExecutorAddr representing the address of the instance to call the object on. For asynchronous methods the resulting function object (AsyncMethod) forwards the Return callback through to the method. For synchronous methods the method is called and the result passed to the Return callback.

WrapperFunction::handleWithAsyncMethod can be used to wrap asynchronous methods
(void methods whose first arguments are Return callbacks) for use with
WrapperFunction::handle.

WrapperFunction::handleWithSyncMethod can be used to wrap regular
(non-asynchronous) methods for use with WrapperFunction::handle.

Both variants return function objects that take a Return callback as their
first argument, and an ExecutorAddr representing the address of the instance to
call the object on. For asynchronous methods the resulting function object
(AsyncMethod<method-ptr>) forwards the Return callback through to the method.
For synchronous methods the method is called and the result passed to the
Return callback.
@lhames lhames merged commit 36cfdeb into llvm:main Oct 6, 2025
10 checks passed
@lhames lhames deleted the orc-rt-wrapperfunction-method-handlers branch October 6, 2025 04:46
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 6, 2025
…e. (llvm#162035)

WrapperFunction::handleWithAsyncMethod can be used to wrap asynchronous
methods (void methods whose first arguments are Return callbacks) for
use with WrapperFunction::handle.

WrapperFunction::handleWithSyncMethod can be used to wrap regular
(non-asynchronous) methods for use with WrapperFunction::handle.

Both variants return function objects that take a Return callback as
their first argument, and an ExecutorAddr representing the address of
the instance to call the object on. For asynchronous methods the
resulting function object (AsyncMethod<method-ptr>) forwards the Return
callback through to the method. For synchronous methods the method is
called and the result passed to the Return callback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant