@@ -88,7 +88,7 @@ class PartitioningIRMaterializationUnit : public IRMaterializationUnit {
88
88
Parent(Parent) {}
89
89
90
90
private:
91
- void materialize (std::unique_ptr< MaterializationResponsibility> R) override {
91
+ void materialize (MaterializationResponsibility R) override {
92
92
Parent.emitPartition (std::move (R), std::move (TSM),
93
93
std::move (SymbolToDefinition));
94
94
}
@@ -128,15 +128,15 @@ void CompileOnDemandLayer::setPartitionFunction(PartitionFunction Partition) {
128
128
void CompileOnDemandLayer::setImplMap (ImplSymbolMap *Imp) {
129
129
this ->AliaseeImpls = Imp;
130
130
}
131
- void CompileOnDemandLayer::emit (
132
- std::unique_ptr<MaterializationResponsibility> R, ThreadSafeModule TSM) {
131
+ void CompileOnDemandLayer::emit (MaterializationResponsibility R,
132
+ ThreadSafeModule TSM) {
133
133
assert (TSM && " Null module" );
134
134
135
135
auto &ES = getExecutionSession ();
136
136
137
137
// Sort the callables and non-callables, build re-exports and lodge the
138
138
// actual module with the implementation dylib.
139
- auto &PDR = getPerDylibResources (R-> getTargetJITDylib ());
139
+ auto &PDR = getPerDylibResources (R. getTargetJITDylib ());
140
140
141
141
SymbolAliasMap NonCallables;
142
142
SymbolAliasMap Callables;
@@ -145,7 +145,7 @@ void CompileOnDemandLayer::emit(
145
145
cleanUpModule (M);
146
146
});
147
147
148
- for (auto &KV : R-> getSymbols ()) {
148
+ for (auto &KV : R. getSymbols ()) {
149
149
auto &Name = KV.first ;
150
150
auto &Flags = KV.second ;
151
151
if (Flags.isCallable ())
@@ -158,19 +158,19 @@ void CompileOnDemandLayer::emit(
158
158
// implementation dylib.
159
159
if (auto Err = PDR.getImplDylib ().define (
160
160
std::make_unique<PartitioningIRMaterializationUnit>(
161
- ES, *getManglingOptions (), std::move (TSM), R-> getVModuleKey (),
161
+ ES, *getManglingOptions (), std::move (TSM), R. getVModuleKey (),
162
162
*this ))) {
163
163
ES.reportError (std::move (Err));
164
- R-> failMaterialization ();
164
+ R. failMaterialization ();
165
165
return ;
166
166
}
167
167
168
168
if (!NonCallables.empty ())
169
- R-> replace (reexports (PDR.getImplDylib (), std::move (NonCallables),
170
- JITDylibLookupFlags::MatchAllSymbols));
169
+ R. replace (reexports (PDR.getImplDylib (), std::move (NonCallables),
170
+ JITDylibLookupFlags::MatchAllSymbols));
171
171
if (!Callables.empty ())
172
- R-> replace (lazyReexports (LCTMgr, PDR.getISManager (), PDR.getImplDylib (),
173
- std::move (Callables), AliaseeImpls));
172
+ R. replace (lazyReexports (LCTMgr, PDR.getISManager (), PDR.getImplDylib (),
173
+ std::move (Callables), AliaseeImpls));
174
174
}
175
175
176
176
CompileOnDemandLayer::PerDylibResources &
@@ -247,7 +247,7 @@ void CompileOnDemandLayer::expandPartition(GlobalValueSet &Partition) {
247
247
}
248
248
249
249
void CompileOnDemandLayer::emitPartition (
250
- std::unique_ptr< MaterializationResponsibility> R, ThreadSafeModule TSM,
250
+ MaterializationResponsibility R, ThreadSafeModule TSM,
251
251
IRMaterializationUnit::SymbolNameToDefinitionMap Defs) {
252
252
253
253
// FIXME: Need a 'notify lazy-extracting/emitting' callback to tie the
@@ -257,8 +257,8 @@ void CompileOnDemandLayer::emitPartition(
257
257
258
258
auto &ES = getExecutionSession ();
259
259
GlobalValueSet RequestedGVs;
260
- for (auto &Name : R-> getRequestedSymbols ()) {
261
- if (Name == R-> getInitializerSymbol ())
260
+ for (auto &Name : R. getRequestedSymbols ()) {
261
+ if (Name == R. getInitializerSymbol ())
262
262
TSM.withModuleDo ([&](Module &M) {
263
263
for (auto &GV : getStaticInitGVs (M))
264
264
RequestedGVs.insert (&GV);
@@ -285,9 +285,9 @@ void CompileOnDemandLayer::emitPartition(
285
285
286
286
// If the partition is empty, return the whole module to the symbol table.
287
287
if (GVsToExtract->empty ()) {
288
- R-> replace (std::make_unique<PartitioningIRMaterializationUnit>(
289
- std::move (TSM), R-> getVModuleKey (), R-> getSymbols (),
290
- R-> getInitializerSymbol (), std::move (Defs), *this ));
288
+ R. replace (std::make_unique<PartitioningIRMaterializationUnit>(
289
+ std::move (TSM), R. getVModuleKey (), R. getSymbols (),
290
+ R. getInitializerSymbol (), std::move (Defs), *this ));
291
291
return ;
292
292
}
293
293
@@ -308,7 +308,7 @@ void CompileOnDemandLayer::emitPartition(
308
308
IRSymbolMapper::add (ES, *getManglingOptions (),
309
309
PromotedGlobals, SymbolFlags);
310
310
311
- if (auto Err = R-> defineMaterializing (SymbolFlags))
311
+ if (auto Err = R. defineMaterializing (SymbolFlags))
312
312
return std::move (Err);
313
313
}
314
314
@@ -348,12 +348,12 @@ void CompileOnDemandLayer::emitPartition(
348
348
349
349
if (!ExtractedTSM) {
350
350
ES.reportError (ExtractedTSM.takeError ());
351
- R-> failMaterialization ();
351
+ R. failMaterialization ();
352
352
return ;
353
353
}
354
354
355
- R-> replace (std::make_unique<PartitioningIRMaterializationUnit>(
356
- ES, *getManglingOptions (), std::move (TSM), R-> getVModuleKey (), *this ));
355
+ R. replace (std::make_unique<PartitioningIRMaterializationUnit>(
356
+ ES, *getManglingOptions (), std::move (TSM), R. getVModuleKey (), *this ));
357
357
BaseLayer.emit (std::move (R), std::move (*ExtractedTSM));
358
358
}
359
359
0 commit comments