Skip to content

Commit 479599a

Browse files
lhamesmemfrob
authored andcommitted
[ORC] Rename TargetProcessControl to ExecutorProcessControl. NFC.
This is a first step towards consistently using the term 'executor' for the process that executes JIT'd code. I've opted for 'executor' as the preferred term over 'target' as target is already heavily overloaded ("the target machine for the executor" is much clearer than "the target machine for the target").
1 parent c8c6cec commit 479599a

28 files changed

+477
-469
lines changed

llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
1919
#include "llvm/ExecutionEngine/Orc/Core.h"
2020
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
21+
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
2122
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
2223
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
2324
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
24-
#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"
2525
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
2626
#include "llvm/IR/DataLayout.h"
2727
#include "llvm/IR/LLVMContext.h"
@@ -32,7 +32,7 @@ namespace orc {
3232

3333
class KaleidoscopeJIT {
3434
private:
35-
std::unique_ptr<TargetProcessControl> TPC;
35+
std::unique_ptr<ExecutorProcessControl> EPC;
3636
std::unique_ptr<ExecutionSession> ES;
3737

3838
DataLayout DL;
@@ -44,10 +44,10 @@ class KaleidoscopeJIT {
4444
JITDylib &MainJD;
4545

4646
public:
47-
KaleidoscopeJIT(std::unique_ptr<TargetProcessControl> TPC,
47+
KaleidoscopeJIT(std::unique_ptr<ExecutorProcessControl> EPC,
4848
std::unique_ptr<ExecutionSession> ES,
4949
JITTargetMachineBuilder JTMB, DataLayout DL)
50-
: TPC(std::move(TPC)), ES(std::move(ES)), DL(std::move(DL)),
50+
: EPC(std::move(EPC)), ES(std::move(ES)), DL(std::move(DL)),
5151
Mangle(*this->ES, this->DL),
5252
ObjectLayer(*this->ES,
5353
[]() { return std::make_unique<SectionMemoryManager>(); }),
@@ -66,19 +66,19 @@ class KaleidoscopeJIT {
6666

6767
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
6868
auto SSP = std::make_shared<SymbolStringPool>();
69-
auto TPC = SelfTargetProcessControl::Create(SSP);
70-
if (!TPC)
71-
return TPC.takeError();
69+
auto EPC = SelfExecutorProcessControl::Create(SSP);
70+
if (!EPC)
71+
return EPC.takeError();
7272

7373
auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
7474

75-
JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
75+
JITTargetMachineBuilder JTMB((*EPC)->getTargetTriple());
7676

7777
auto DL = JTMB.getDefaultDataLayoutForTarget();
7878
if (!DL)
7979
return DL.takeError();
8080

81-
return std::make_unique<KaleidoscopeJIT>(std::move(*TPC), std::move(ES),
81+
return std::make_unique<KaleidoscopeJIT>(std::move(*EPC), std::move(ES),
8282
std::move(JTMB), std::move(*DL));
8383
}
8484

llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
1919
#include "llvm/ExecutionEngine/Orc/Core.h"
2020
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
21+
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
2122
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
2223
#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
2324
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
2425
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
25-
#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"
2626
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
2727
#include "llvm/IR/DataLayout.h"
2828
#include "llvm/IR/LLVMContext.h"
@@ -37,7 +37,7 @@ namespace orc {
3737

3838
class KaleidoscopeJIT {
3939
private:
40-
std::unique_ptr<TargetProcessControl> TPC;
40+
std::unique_ptr<ExecutorProcessControl> EPC;
4141
std::unique_ptr<ExecutionSession> ES;
4242

4343
DataLayout DL;
@@ -50,10 +50,10 @@ class KaleidoscopeJIT {
5050
JITDylib &MainJD;
5151

5252
public:
53-
KaleidoscopeJIT(std::unique_ptr<TargetProcessControl> TPC,
53+
KaleidoscopeJIT(std::unique_ptr<ExecutorProcessControl> EPC,
5454
std::unique_ptr<ExecutionSession> ES,
5555
JITTargetMachineBuilder JTMB, DataLayout DL)
56-
: TPC(std::move(TPC)), ES(std::move(ES)), DL(std::move(DL)),
56+
: EPC(std::move(EPC)), ES(std::move(ES)), DL(std::move(DL)),
5757
Mangle(*this->ES, this->DL),
5858
ObjectLayer(*this->ES,
5959
[]() { return std::make_unique<SectionMemoryManager>(); }),
@@ -73,19 +73,19 @@ class KaleidoscopeJIT {
7373

7474
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
7575
auto SSP = std::make_shared<SymbolStringPool>();
76-
auto TPC = SelfTargetProcessControl::Create(SSP);
77-
if (!TPC)
78-
return TPC.takeError();
76+
auto EPC = SelfExecutorProcessControl::Create(SSP);
77+
if (!EPC)
78+
return EPC.takeError();
7979

8080
auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
8181

82-
JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
82+
JITTargetMachineBuilder JTMB((*EPC)->getTargetTriple());
8383

8484
auto DL = JTMB.getDefaultDataLayoutForTarget();
8585
if (!DL)
8686
return DL.takeError();
8787

88-
return std::make_unique<KaleidoscopeJIT>(std::move(*TPC), std::move(ES),
88+
return std::make_unique<KaleidoscopeJIT>(std::move(*EPC), std::move(ES),
8989
std::move(JTMB), std::move(*DL));
9090
}
9191

llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
1919
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
2020
#include "llvm/ExecutionEngine/Orc/Core.h"
21+
#include "llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h"
2122
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
23+
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
2224
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
2325
#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
2426
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
2527
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
26-
#include "llvm/ExecutionEngine/Orc/TPCIndirectionUtils.h"
27-
#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"
2828
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
2929
#include "llvm/IR/DataLayout.h"
3030
#include "llvm/IR/LLVMContext.h"
@@ -39,9 +39,9 @@ namespace orc {
3939

4040
class KaleidoscopeJIT {
4141
private:
42-
std::unique_ptr<TargetProcessControl> TPC;
42+
std::unique_ptr<ExecutorProcessControl> EPC;
4343
std::unique_ptr<ExecutionSession> ES;
44-
std::unique_ptr<TPCIndirectionUtils> TPCIU;
44+
std::unique_ptr<EPCIndirectionUtils> EPCIU;
4545

4646
DataLayout DL;
4747
MangleAndInterner Mangle;
@@ -59,20 +59,20 @@ class KaleidoscopeJIT {
5959
}
6060

6161
public:
62-
KaleidoscopeJIT(std::unique_ptr<TargetProcessControl> TPC,
62+
KaleidoscopeJIT(std::unique_ptr<ExecutorProcessControl> EPC,
6363
std::unique_ptr<ExecutionSession> ES,
64-
std::unique_ptr<TPCIndirectionUtils> TPCIU,
64+
std::unique_ptr<EPCIndirectionUtils> EPCIU,
6565
JITTargetMachineBuilder JTMB, DataLayout DL)
66-
: TPC(std::move(TPC)), ES(std::move(ES)), TPCIU(std::move(TPCIU)),
66+
: EPC(std::move(EPC)), ES(std::move(ES)), EPCIU(std::move(EPCIU)),
6767
DL(std::move(DL)), Mangle(*this->ES, this->DL),
6868
ObjectLayer(*this->ES,
6969
[]() { return std::make_unique<SectionMemoryManager>(); }),
7070
CompileLayer(*this->ES, ObjectLayer,
7171
std::make_unique<ConcurrentIRCompiler>(std::move(JTMB))),
7272
OptimizeLayer(*this->ES, CompileLayer, optimizeModule),
7373
CODLayer(*this->ES, OptimizeLayer,
74-
this->TPCIU->getLazyCallThroughManager(),
75-
[this] { return this->TPCIU->createIndirectStubsManager(); }),
74+
this->EPCIU->getLazyCallThroughManager(),
75+
[this] { return this->EPCIU->createIndirectStubsManager(); }),
7676
MainJD(this->ES->createBareJITDylib("<main>")) {
7777
MainJD.addGenerator(
7878
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(
@@ -82,36 +82,36 @@ class KaleidoscopeJIT {
8282
~KaleidoscopeJIT() {
8383
if (auto Err = ES->endSession())
8484
ES->reportError(std::move(Err));
85-
if (auto Err = TPCIU->cleanup())
85+
if (auto Err = EPCIU->cleanup())
8686
ES->reportError(std::move(Err));
8787
}
8888

8989
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
9090
auto SSP = std::make_shared<SymbolStringPool>();
91-
auto TPC = SelfTargetProcessControl::Create(SSP);
92-
if (!TPC)
93-
return TPC.takeError();
91+
auto EPC = SelfExecutorProcessControl::Create(SSP);
92+
if (!EPC)
93+
return EPC.takeError();
9494

9595
auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
9696

97-
auto TPCIU = TPCIndirectionUtils::Create(**TPC);
98-
if (!TPCIU)
99-
return TPCIU.takeError();
97+
auto EPCIU = EPCIndirectionUtils::Create(**EPC);
98+
if (!EPCIU)
99+
return EPCIU.takeError();
100100

101-
(*TPCIU)->createLazyCallThroughManager(
101+
(*EPCIU)->createLazyCallThroughManager(
102102
*ES, pointerToJITTargetAddress(&handleLazyCallThroughError));
103103

104-
if (auto Err = setUpInProcessLCTMReentryViaTPCIU(**TPCIU))
104+
if (auto Err = setUpInProcessLCTMReentryViaEPCIU(**EPCIU))
105105
return std::move(Err);
106106

107-
JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
107+
JITTargetMachineBuilder JTMB((*EPC)->getTargetTriple());
108108

109109
auto DL = JTMB.getDefaultDataLayoutForTarget();
110110
if (!DL)
111111
return DL.takeError();
112112

113-
return std::make_unique<KaleidoscopeJIT>(std::move(*TPC), std::move(ES),
114-
std::move(*TPCIU), std::move(JTMB),
113+
return std::make_unique<KaleidoscopeJIT>(std::move(*EPC), std::move(ES),
114+
std::move(*EPCIU), std::move(JTMB),
115115
std::move(*DL));
116116
}
117117

llvm/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
1919
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
2020
#include "llvm/ExecutionEngine/Orc/Core.h"
21+
#include "llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h"
2122
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
23+
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
2224
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
2325
#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
2426
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
2527
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
26-
#include "llvm/ExecutionEngine/Orc/TPCIndirectionUtils.h"
27-
#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"
2828
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
2929
#include "llvm/IR/DataLayout.h"
3030
#include "llvm/IR/LLVMContext.h"
@@ -126,9 +126,9 @@ void KaleidoscopeASTMaterializationUnit::materialize(
126126

127127
class KaleidoscopeJIT {
128128
private:
129-
std::unique_ptr<TargetProcessControl> TPC;
129+
std::unique_ptr<ExecutorProcessControl> EPC;
130130
std::unique_ptr<ExecutionSession> ES;
131-
std::unique_ptr<TPCIndirectionUtils> TPCIU;
131+
std::unique_ptr<EPCIndirectionUtils> EPCIU;
132132

133133
DataLayout DL;
134134
MangleAndInterner Mangle;
@@ -146,11 +146,11 @@ class KaleidoscopeJIT {
146146
}
147147

148148
public:
149-
KaleidoscopeJIT(std::unique_ptr<TargetProcessControl> TPC,
149+
KaleidoscopeJIT(std::unique_ptr<ExecutorProcessControl> EPC,
150150
std::unique_ptr<ExecutionSession> ES,
151-
std::unique_ptr<TPCIndirectionUtils> TPCIU,
151+
std::unique_ptr<EPCIndirectionUtils> EPCIU,
152152
JITTargetMachineBuilder JTMB, DataLayout DL)
153-
: TPC(std::move(TPC)), ES(std::move(ES)), TPCIU(std::move(TPCIU)),
153+
: EPC(std::move(EPC)), ES(std::move(ES)), EPCIU(std::move(EPCIU)),
154154
DL(std::move(DL)), Mangle(*this->ES, this->DL),
155155
ObjectLayer(*this->ES,
156156
[]() { return std::make_unique<SectionMemoryManager>(); }),
@@ -167,36 +167,36 @@ class KaleidoscopeJIT {
167167
~KaleidoscopeJIT() {
168168
if (auto Err = ES->endSession())
169169
ES->reportError(std::move(Err));
170-
if (auto Err = TPCIU->cleanup())
170+
if (auto Err = EPCIU->cleanup())
171171
ES->reportError(std::move(Err));
172172
}
173173

174174
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
175175
auto SSP = std::make_shared<SymbolStringPool>();
176-
auto TPC = SelfTargetProcessControl::Create(SSP);
177-
if (!TPC)
178-
return TPC.takeError();
176+
auto EPC = SelfExecutorProcessControl::Create(SSP);
177+
if (!EPC)
178+
return EPC.takeError();
179179

180180
auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
181181

182-
auto TPCIU = TPCIndirectionUtils::Create(**TPC);
183-
if (!TPCIU)
184-
return TPCIU.takeError();
182+
auto EPCIU = EPCIndirectionUtils::Create(**EPC);
183+
if (!EPCIU)
184+
return EPCIU.takeError();
185185

186-
(*TPCIU)->createLazyCallThroughManager(
186+
(*EPCIU)->createLazyCallThroughManager(
187187
*ES, pointerToJITTargetAddress(&handleLazyCallThroughError));
188188

189-
if (auto Err = setUpInProcessLCTMReentryViaTPCIU(**TPCIU))
189+
if (auto Err = setUpInProcessLCTMReentryViaEPCIU(**EPCIU))
190190
return std::move(Err);
191191

192-
JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
192+
JITTargetMachineBuilder JTMB((*EPC)->getTargetTriple());
193193

194194
auto DL = JTMB.getDefaultDataLayoutForTarget();
195195
if (!DL)
196196
return DL.takeError();
197197

198-
return std::make_unique<KaleidoscopeJIT>(std::move(*TPC), std::move(ES),
199-
std::move(*TPCIU), std::move(JTMB),
198+
return std::make_unique<KaleidoscopeJIT>(std::move(*EPC), std::move(ES),
199+
std::move(*EPCIU), std::move(JTMB),
200200
std::move(*DL));
201201
}
202202

llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
1919
#include "llvm/ExecutionEngine/Orc/Core.h"
2020
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
21+
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
2122
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
2223
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
2324
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
24-
#include "llvm/ExecutionEngine/Orc/TargetProcessControl.h"
2525
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
2626
#include "llvm/IR/DataLayout.h"
2727
#include "llvm/IR/LLVMContext.h"
@@ -32,7 +32,7 @@ namespace orc {
3232

3333
class KaleidoscopeJIT {
3434
private:
35-
std::unique_ptr<TargetProcessControl> TPC;
35+
std::unique_ptr<ExecutorProcessControl> EPC;
3636
std::unique_ptr<ExecutionSession> ES;
3737

3838
DataLayout DL;
@@ -44,10 +44,10 @@ class KaleidoscopeJIT {
4444
JITDylib &MainJD;
4545

4646
public:
47-
KaleidoscopeJIT(std::unique_ptr<TargetProcessControl> TPC,
47+
KaleidoscopeJIT(std::unique_ptr<ExecutorProcessControl> EPC,
4848
std::unique_ptr<ExecutionSession> ES,
4949
JITTargetMachineBuilder JTMB, DataLayout DL)
50-
: TPC(std::move(TPC)), ES(std::move(ES)), DL(std::move(DL)),
50+
: EPC(std::move(EPC)), ES(std::move(ES)), DL(std::move(DL)),
5151
Mangle(*this->ES, this->DL),
5252
ObjectLayer(*this->ES,
5353
[]() { return std::make_unique<SectionMemoryManager>(); }),
@@ -66,19 +66,19 @@ class KaleidoscopeJIT {
6666

6767
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
6868
auto SSP = std::make_shared<SymbolStringPool>();
69-
auto TPC = SelfTargetProcessControl::Create(SSP);
70-
if (!TPC)
71-
return TPC.takeError();
69+
auto EPC = SelfExecutorProcessControl::Create(SSP);
70+
if (!EPC)
71+
return EPC.takeError();
7272

7373
auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
7474

75-
JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
75+
JITTargetMachineBuilder JTMB((*EPC)->getTargetTriple());
7676

7777
auto DL = JTMB.getDefaultDataLayoutForTarget();
7878
if (!DL)
7979
return DL.takeError();
8080

81-
return std::make_unique<KaleidoscopeJIT>(std::move(*TPC), std::move(ES),
81+
return std::make_unique<KaleidoscopeJIT>(std::move(*EPC), std::move(ES),
8282
std::move(JTMB), std::move(*DL));
8383
}
8484

0 commit comments

Comments
 (0)