LLVM 24.0.0git
BindCallControllerHandler.h
Go to the documentation of this file.
1//===- BindCallControllerHandler.h - Bind handlers from specs ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Bind call-controller handlers using a handler spec (e.g. sps::HandlerSpec),
10// which supplies the default tag name and the serialization protocol. These
11// mirror recordProxy, which does the same for proxies.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_EXECUTIONENGINE_ORC_BINDCALLCONTROLLERHANDLER_H
16#define LLVM_EXECUTIONENGINE_ORC_BINDCALLCONTROLLERHANDLER_H
17
21
22#include <utility>
23
24namespace llvm::orc {
25
26/// Bind H, using the given spec, to the tag with the spec's default name.
27template <typename HandlerSpecT, typename HandlerT>
31 HandlerSpecT::Name, HandlerSpecT::wrap(std::forward<HandlerT>(H)), LF);
32}
33
34/// Bind H, using the given spec, to the tag with the given name rather than
35/// the spec's default name.
36template <typename HandlerSpecT, typename HandlerT>
43
44/// Bind a class method, using the given spec, to the tag with the spec's
45/// default name.
46template <typename HandlerSpecT, typename ClassT, typename... MethodArgTs>
48 ClassT *Instance, void (ClassT::*Method)(MethodArgTs...),
50 return bindCallControllerHandler<HandlerSpecT>(HandlerSpecT::Name, Instance,
51 Method, LF);
52}
53
54/// Bind a class method, using the given spec, to the tag with the given name
55/// rather than the spec's default name.
56template <typename HandlerSpecT, typename ClassT, typename... MethodArgTs>
58 SymbolNameSpec Name, ClassT *Instance,
59 void (ClassT::*Method)(MethodArgTs...),
62 Name,
63 [Instance, Method](MethodArgTs &&...MethodArgs) {
64 (Instance->*Method)(std::forward<MethodArgTs>(MethodArgs)...);
65 },
66 LF);
67}
68
69} // namespace llvm::orc
70
71#endif // LLVM_EXECUTIONENGINE_ORC_BINDCALLCONTROLLERHANDLER_H
#define H(x, y, z)
Definition MD5.cpp:56
Associates a call-controller handler with the name of the tag symbol that the executor will use to ca...
Definition Core.h:1133
A symbol name together with the naming level (SymbolNameKind) it is expressed in, so that a Mangler /...
ExecutionSession::CallControllerHandlerBinding bindCallControllerHandler(HandlerT &&H, SymbolLookupFlags LF=SymbolLookupFlags::RequiredSymbol)
Bind H, using the given spec, to the tag with the spec's default name.
SymbolLookupFlags
Lookup flags that apply to each symbol in a lookup.
static std::unique_ptr< UnwindInfoManager > Instance