LLVM: include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_SIMPLEREMOTEEPCUTILS_H

15#define LLVM_EXECUTIONENGINE_ORC_SHARED_SIMPLEREMOTEEPCUTILS_H

16

24

25#include

26#include

27#include

28#include

29

30namespace llvm {

31namespace orc {

32

37

45

52

54

56public:

58

60

61

62

63

64

65

69

70

71

72

73

74

75

77};

78

80public:

82

83

84

85

86

87

89

90

91

92

93

96

97

98

99

101};

102

103

105public:

106

107

110

111

112

115 return Create(C, FD, FD);

116 }

117

119

120 Error start() override;

121

124

125 void disconnect() override;

126

127private:

129 int OutFD)

130 : C(C), InFD(InFD), OutFD(OutFD) {}

131

132 Error readBytes(char *Dst, size_t Size, bool *IsEOF = nullptr);

133 int writeBytes(const char *Src, size_t Size);

134 void listenLoop();

135

136 std::mutex M;

137 SimpleRemoteEPCTransportClient &C;

138 std::thread ListenerThread;

139 int InFD, OutFD;

140 std::atomic Disconnected{false};

141};

142

147

149

154

156

158

160

162

163

168

169template <>

187

188template <>

190public:

194

199

202 IB, V.H, V.Symbols);

203 }

204};

205

206template <>

209public:

211 return SPSSimpleRemoteEPCExecutorInfo::AsArgList ::size(

212 SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols);

213 }

214

217 return SPSSimpleRemoteEPCExecutorInfo::AsArgList ::serialize(

218 OB, SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols);

219 }

220

222 return SPSSimpleRemoteEPCExecutorInfo::AsArgList ::deserialize(

223 IB, SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols);

224 }

225};

226

229

233

234}

235}

236}

237

238#endif

This file defines the StringMap class.

This file defines the SmallVector class.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

Lightweight error class with error context and mandatory checking.

Tagged union holding either a T or a Error.

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...

Represents an address in the executor process.

Uses read/write on FileDescriptors for transport.

Definition SimpleRemoteEPCUtils.h:104

static Expected< std::unique_ptr< FDSimpleRemoteEPCTransport > > Create(SimpleRemoteEPCTransportClient &C, int InFD, int OutFD)

Create a FDSimpleRemoteEPCTransport using the given FDs for reading (InFD) and writing (OutFD).

static Expected< std::unique_ptr< FDSimpleRemoteEPCTransport > > Create(SimpleRemoteEPCTransportClient &C, int FD)

Create a FDSimpleRemoteEPCTransport using the given FD for both reading and writing.

Definition SimpleRemoteEPCUtils.h:114

HandleMessageAction

Definition SimpleRemoteEPCUtils.h:57

@ ContinueSession

Definition SimpleRemoteEPCUtils.h:57

@ EndSession

Definition SimpleRemoteEPCUtils.h:57

virtual Expected< HandleMessageAction > handleMessage(SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, SimpleRemoteEPCArgBytesVector ArgBytes)=0

Handle receipt of a message.

virtual void handleDisconnect(Error Err)=0

Handle a disconnection from the underlying transport.

virtual ~SimpleRemoteEPCTransportClient()

virtual ~SimpleRemoteEPCTransport()

virtual void disconnect()=0

Trigger disconnection from the transport.

virtual Error sendMessage(SimpleRemoteEPCOpcode OpC, uint64_t SeqNo, ExecutorAddr TagAddr, ArrayRef< char > ArgBytes)=0

Send a SimpleRemoteEPC message.

virtual Error start()=0

Called during setup of the client to indicate that the client is ready to receive messages.

@ C

The default llvm calling convention, compatible with C.

LLVM_ABI const char * DispatchFnName

LLVM_ABI const char * ExecutorSessionObjectName

SimpleRemoteEPCOpcode

Definition SimpleRemoteEPCUtils.h:38

@ CallWrapper

Definition SimpleRemoteEPCUtils.h:42

@ Hangup

Definition SimpleRemoteEPCUtils.h:40

@ Result

Definition SimpleRemoteEPCUtils.h:41

@ Setup

Definition SimpleRemoteEPCUtils.h:39

@ LastOpC

Definition SimpleRemoteEPCUtils.h:43

std::vector< RemoteSymbolLookupSetElement > RemoteSymbolLookupSet

Definition SimpleRemoteEPCUtils.h:148

SmallVector< char, 128 > SimpleRemoteEPCArgBytesVector

Definition SimpleRemoteEPCUtils.h:53

This is an optimization pass for GlobalISel generic memory operations.

bool Required

Definition SimpleRemoteEPCUtils.h:145

std::string Name

Definition SimpleRemoteEPCUtils.h:144

uint64_t H

Definition SimpleRemoteEPCUtils.h:151

RemoteSymbolLookupSet Symbols

Definition SimpleRemoteEPCUtils.h:152

StringMap< ExecutorAddr > BootstrapSymbols

Definition SimpleRemoteEPCUtils.h:50

StringMap< std::vector< char > > BootstrapMap

Definition SimpleRemoteEPCUtils.h:49

uint64_t PageSize

Definition SimpleRemoteEPCUtils.h:48

std::string TargetTriple

Definition SimpleRemoteEPCUtils.h:47