LLVM
24.0.0git
include
llvm
ExecutionEngine
Orc
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
18
#include "
llvm/ExecutionEngine/Orc/Core.h
"
19
#include "
llvm/ExecutionEngine/Orc/Shared/SymbolNameSpec.h
"
20
#include "
llvm/ExecutionEngine/Orc/SymbolLookupSet.h
"
21
22
#include <utility>
23
24
namespace
llvm::orc
{
25
26
/// Bind H, using the given spec, to the tag with the spec's default name.
27
template
<
typename
HandlerSpecT,
typename
HandlerT>
28
ExecutionSession::CallControllerHandlerBinding
bindCallControllerHandler
(
29
HandlerT &&
H
,
SymbolLookupFlags
LF =
SymbolLookupFlags::RequiredSymbol
) {
30
return
ExecutionSession::CallControllerHandlerBinding
(
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.
36
template
<
typename
HandlerSpecT,
typename
HandlerT>
37
ExecutionSession::CallControllerHandlerBinding
bindCallControllerHandler
(
38
SymbolNameSpec
Name, HandlerT &&
H
,
39
SymbolLookupFlags
LF =
SymbolLookupFlags::RequiredSymbol
) {
40
return
ExecutionSession::CallControllerHandlerBinding
(
41
Name, HandlerSpecT::wrap(std::forward<HandlerT>(
H
)), LF);
42
}
43
44
/// Bind a class method, using the given spec, to the tag with the spec's
45
/// default name.
46
template
<
typename
HandlerSpecT,
typename
ClassT,
typename
... MethodArgTs>
47
ExecutionSession::CallControllerHandlerBinding
bindCallControllerHandler
(
48
ClassT *
Instance
,
void
(ClassT::*Method)(MethodArgTs...),
49
SymbolLookupFlags
LF =
SymbolLookupFlags::RequiredSymbol
) {
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.
56
template
<
typename
HandlerSpecT,
typename
ClassT,
typename
... MethodArgTs>
57
ExecutionSession::CallControllerHandlerBinding
bindCallControllerHandler
(
58
SymbolNameSpec
Name, ClassT *
Instance
,
59
void
(ClassT::*Method)(MethodArgTs...),
60
SymbolLookupFlags
LF =
SymbolLookupFlags::RequiredSymbol
) {
61
return
bindCallControllerHandler<HandlerSpecT>
(
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
H
#define H(x, y, z)
Definition
MD5.cpp:56
SymbolLookupSet.h
SymbolNameSpec.h
llvm::orc::ExecutionSession::CallControllerHandlerBinding
Associates a call-controller handler with the name of the tag symbol that the executor will use to ca...
Definition
Core.h:1133
llvm::orc::SymbolNameSpec
A symbol name together with the naming level (SymbolNameKind) it is expressed in, so that a Mangler /...
Definition
SymbolNameSpec.h:39
Core.h
llvm::orc
Definition
AbsoluteSymbols.h:19
llvm::orc::bindCallControllerHandler
ExecutionSession::CallControllerHandlerBinding bindCallControllerHandler(HandlerT &&H, SymbolLookupFlags LF=SymbolLookupFlags::RequiredSymbol)
Bind H, using the given spec, to the tag with the spec's default name.
Definition
BindCallControllerHandler.h:28
llvm::orc::SymbolLookupFlags
SymbolLookupFlags
Lookup flags that apply to each symbol in a lookup.
Definition
SymbolLookupSet.h:41
llvm::orc::SymbolLookupFlags::RequiredSymbol
@ RequiredSymbol
Definition
SymbolLookupSet.h:41
llvm::orc::Instance
static std::unique_ptr< UnwindInfoManager > Instance
Definition
UnwindInfoManager.cpp:62
Generated on
for LLVM by
1.14.0