Skip to content

Commit c0825fa

Browse files
committed
Revert "[ORC] Make MaterializationResponsibility immovable, pass by unique_ptr."
This reverts commit c74900c. This appears to be breaking some builds on macOS and has been causing build failures on Green Dragon (see below). I am reverting this for now, to unblock testing on Green Dragon. http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/18144/console [65/187] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iexamples/ThinLtoJIT -I/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ThinLtoJIT -Iinclude -I/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.9 -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o -MF examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o.d -o examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o -c /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ThinLtoJIT/ThinLtoDiscoveryThread.cpp FAILED: examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iexamples/ThinLtoJIT -I/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ThinLtoJIT -Iinclude -I/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.9 -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o -MF examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o.d -o examples/ThinLtoJIT/CMakeFiles/ThinLtoJIT.dir/ThinLtoDiscoveryThread.cpp.o -c /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ThinLtoJIT/ThinLtoDiscoveryThread.cpp In file included from /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ThinLtoJIT/ThinLtoDiscoveryThread.cpp:7: /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/examples/ThinLtoJIT/ThinLtoInstrumentationLayer.h:37:68: error: non-virtual member function marked 'override' hides virtual member function void emit(MaterializationResponsibility R, ThreadSafeModule TSM) override; ^ /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/Layer.h:103:16: note: hidden overloaded virtual function 'llvm::orc::IRLayer::emit' declared here: type mismatch at 1st parameter ('std::unique_ptr<MaterializationResponsibility>' vs 'llvm::orc::MaterializationResponsibility') virtual void emit(std::unique_ptr<MaterializationResponsibility> R, ^ 1 error generated.
1 parent e6419d3 commit c0825fa

26 files changed

+274
-314
lines changed

llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ class SpeculativeJIT {
113113
this->CODLayer.setImplMap(&Imps);
114114
this->ES->setDispatchMaterialization(
115115
[this](std::unique_ptr<MaterializationUnit> MU,
116-
std::unique_ptr<MaterializationResponsibility> MR) {
117-
CompileThreads.async(
118-
[UnownedMU = MU.release(), UnownedMR = MR.release()]() {
119-
std::unique_ptr<MaterializationUnit> MU(UnownedMU);
120-
std::unique_ptr<MaterializationResponsibility> MR(UnownedMR);
121-
MU->materialize(std::move(MR));
122-
});
116+
MaterializationResponsibility MR) {
117+
// FIXME: Switch to move capture once we have C++14.
118+
auto SharedMU = std::shared_ptr<MaterializationUnit>(std::move(MU));
119+
auto SharedMR =
120+
std::make_shared<MaterializationResponsibility>(std::move(MR));
121+
CompileThreads.async([SharedMU, SharedMR]() {
122+
SharedMU->materialize(std::move(*SharedMR));
123+
});
123124
});
124125
ExitOnErr(S.addSpeculationRuntime(MainJD, Mangle));
125126
LocalCXXRuntimeOverrides CXXRuntimeoverrides;

llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ class CompileOnDemandLayer : public IRLayer {
9696

9797
/// Emits the given module. This should not be called by clients: it will be
9898
/// called by the JIT when a definition added via the add method is requested.
99-
void emit(std::unique_ptr<MaterializationResponsibility> R,
100-
ThreadSafeModule TSM) override;
99+
void emit(MaterializationResponsibility R, ThreadSafeModule TSM) override;
101100

102101
private:
103102
struct PerDylibResources {
@@ -121,8 +120,7 @@ class CompileOnDemandLayer : public IRLayer {
121120

122121
void expandPartition(GlobalValueSet &Partition);
123122

124-
void emitPartition(std::unique_ptr<MaterializationResponsibility> R,
125-
ThreadSafeModule TSM,
123+
void emitPartition(MaterializationResponsibility R, ThreadSafeModule TSM,
126124
IRMaterializationUnit::SymbolNameToDefinitionMap Defs);
127125

128126
mutable std::mutex CODLayerMutex;

llvm/include/llvm/ExecutionEngine/Orc/Core.h

+17-20
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ class UnexpectedSymbolDefinitions : public ErrorInfo<UnexpectedSymbolDefinitions
410410
class MaterializationResponsibility {
411411
friend class MaterializationUnit;
412412
public:
413-
MaterializationResponsibility(MaterializationResponsibility &&) = delete;
413+
MaterializationResponsibility(MaterializationResponsibility &&) = default;
414414
MaterializationResponsibility &
415415
operator=(MaterializationResponsibility &&) = delete;
416416

@@ -514,8 +514,8 @@ class MaterializationResponsibility {
514514
/// Delegates responsibility for the given symbols to the returned
515515
/// materialization responsibility. Useful for breaking up work between
516516
/// threads, or different kinds of materialization processes.
517-
std::unique_ptr<MaterializationResponsibility>
518-
delegate(const SymbolNameSet &Symbols, VModuleKey NewKey = VModuleKey());
517+
MaterializationResponsibility delegate(const SymbolNameSet &Symbols,
518+
VModuleKey NewKey = VModuleKey());
519519

520520
void addDependencies(const SymbolStringPtr &Name,
521521
const SymbolDependenceMap &Dependencies);
@@ -577,8 +577,7 @@ class MaterializationUnit {
577577
/// Implementations of this method should materialize all symbols
578578
/// in the materialzation unit, except for those that have been
579579
/// previously discarded.
580-
virtual void
581-
materialize(std::unique_ptr<MaterializationResponsibility> R) = 0;
580+
virtual void materialize(MaterializationResponsibility R) = 0;
582581

583582
/// Called by JITDylibs to notify MaterializationUnits that the given symbol
584583
/// has been overridden.
@@ -595,11 +594,10 @@ class MaterializationUnit {
595594
private:
596595
virtual void anchor();
597596

598-
std::unique_ptr<MaterializationResponsibility>
597+
MaterializationResponsibility
599598
createMaterializationResponsibility(std::shared_ptr<JITDylib> JD) {
600-
return std::unique_ptr<MaterializationResponsibility>(
601-
new MaterializationResponsibility(std::move(JD), std::move(SymbolFlags),
602-
std::move(InitSymbol), K));
599+
return MaterializationResponsibility(std::move(JD), std::move(SymbolFlags),
600+
std::move(InitSymbol), K);
603601
}
604602

605603
/// Implementations of this method should discard the given symbol
@@ -623,7 +621,7 @@ class AbsoluteSymbolsMaterializationUnit : public MaterializationUnit {
623621
StringRef getName() const override;
624622

625623
private:
626-
void materialize(std::unique_ptr<MaterializationResponsibility> R) override;
624+
void materialize(MaterializationResponsibility R) override;
627625
void discard(const JITDylib &JD, const SymbolStringPtr &Name) override;
628626
static SymbolFlagsMap extractFlags(const SymbolMap &Symbols);
629627

@@ -665,7 +663,7 @@ class ReExportsMaterializationUnit : public MaterializationUnit {
665663
StringRef getName() const override;
666664

667665
private:
668-
void materialize(std::unique_ptr<MaterializationResponsibility> R) override;
666+
void materialize(MaterializationResponsibility R) override;
669667
void discard(const JITDylib &JD, const SymbolStringPtr &Name) override;
670668
static SymbolFlagsMap extractFlags(const SymbolAliasMap &Aliases);
671669

@@ -1118,7 +1116,7 @@ class ExecutionSession {
11181116
/// For dispatching MaterializationUnit::materialize calls.
11191117
using DispatchMaterializationFunction =
11201118
std::function<void(std::unique_ptr<MaterializationUnit> MU,
1121-
std::unique_ptr<MaterializationResponsibility> MR)>;
1119+
MaterializationResponsibility MR)>;
11221120

11231121
/// Construct an ExecutionSession.
11241122
///
@@ -1270,11 +1268,10 @@ class ExecutionSession {
12701268
SymbolState RequiredState = SymbolState::Ready);
12711269

12721270
/// Materialize the given unit.
1273-
void
1274-
dispatchMaterialization(std::unique_ptr<MaterializationUnit> MU,
1275-
std::unique_ptr<MaterializationResponsibility> MR) {
1271+
void dispatchMaterialization(std::unique_ptr<MaterializationUnit> MU,
1272+
MaterializationResponsibility MR) {
12761273
assert(MU && "MU must be non-null");
1277-
DEBUG_WITH_TYPE("orc", dumpDispatchInfo(MR->getTargetJITDylib(), *MU));
1274+
DEBUG_WITH_TYPE("orc", dumpDispatchInfo(MR.getTargetJITDylib(), *MU));
12781275
DispatchMaterialization(std::move(MU), std::move(MR));
12791276
}
12801277

@@ -1286,9 +1283,9 @@ class ExecutionSession {
12861283
logAllUnhandledErrors(std::move(Err), errs(), "JIT session error: ");
12871284
}
12881285

1289-
static void materializeOnCurrentThread(
1290-
std::unique_ptr<MaterializationUnit> MU,
1291-
std::unique_ptr<MaterializationResponsibility> MR) {
1286+
static void
1287+
materializeOnCurrentThread(std::unique_ptr<MaterializationUnit> MU,
1288+
MaterializationResponsibility MR) {
12921289
MU->materialize(std::move(MR));
12931290
}
12941291

@@ -1312,7 +1309,7 @@ class ExecutionSession {
13121309
// with callbacks from asynchronous queries.
13131310
mutable std::recursive_mutex OutstandingMUsMutex;
13141311
std::vector<std::pair<std::unique_ptr<MaterializationUnit>,
1315-
std::unique_ptr<MaterializationResponsibility>>>
1312+
MaterializationResponsibility>>
13161313
OutstandingMUs;
13171314
};
13181315

llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ class IRCompileLayer : public IRLayer {
5555

5656
void setNotifyCompiled(NotifyCompiledFunction NotifyCompiled);
5757

58-
void emit(std::unique_ptr<MaterializationResponsibility> R,
59-
ThreadSafeModule TSM) override;
58+
void emit(MaterializationResponsibility R, ThreadSafeModule TSM) override;
6059

6160
private:
6261
mutable std::mutex IRLayerMutex;

llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ class IRTransformLayer : public IRLayer {
3737
this->Transform = std::move(Transform);
3838
}
3939

40-
void emit(std::unique_ptr<MaterializationResponsibility> R,
41-
ThreadSafeModule TSM) override;
40+
void emit(MaterializationResponsibility R, ThreadSafeModule TSM) override;
4241

4342
static ThreadSafeModule identityTransform(ThreadSafeModule TSM,
4443
MaterializationResponsibility &R) {

llvm/include/llvm/ExecutionEngine/Orc/Layer.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ class IRLayer {
100100
VModuleKey K = VModuleKey());
101101

102102
/// Emit should materialize the given IR.
103-
virtual void emit(std::unique_ptr<MaterializationResponsibility> R,
104-
ThreadSafeModule TSM) = 0;
103+
virtual void emit(MaterializationResponsibility R, ThreadSafeModule TSM) = 0;
105104

106105
private:
107106
bool CloneToNewContextOnEmit = false;
@@ -118,7 +117,8 @@ class BasicIRLayerMaterializationUnit : public IRMaterializationUnit {
118117
ThreadSafeModule TSM, VModuleKey K);
119118

120119
private:
121-
void materialize(std::unique_ptr<MaterializationResponsibility> R) override;
120+
121+
void materialize(MaterializationResponsibility R) override;
122122

123123
IRLayer &L;
124124
VModuleKey K;
@@ -139,7 +139,7 @@ class ObjectLayer {
139139
VModuleKey K = VModuleKey());
140140

141141
/// Emit should materialize the given IR.
142-
virtual void emit(std::unique_ptr<MaterializationResponsibility> R,
142+
virtual void emit(MaterializationResponsibility R,
143143
std::unique_ptr<MemoryBuffer> O) = 0;
144144

145145
private:
@@ -162,7 +162,8 @@ class BasicObjectLayerMaterializationUnit : public MaterializationUnit {
162162
StringRef getName() const override;
163163

164164
private:
165-
void materialize(std::unique_ptr<MaterializationResponsibility> R) override;
165+
166+
void materialize(MaterializationResponsibility R) override;
166167
void discard(const JITDylib &JD, const SymbolStringPtr &Name) override;
167168

168169
ObjectLayer &L;

llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class LazyReexportsMaterializationUnit : public MaterializationUnit {
149149
StringRef getName() const override;
150150

151151
private:
152-
void materialize(std::unique_ptr<MaterializationResponsibility> R) override;
152+
void materialize(MaterializationResponsibility R) override;
153153
void discard(const JITDylib &JD, const SymbolStringPtr &Name) override;
154154
static SymbolFlagsMap extractFlags(const SymbolAliasMap &Aliases);
155155

llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class ObjectLinkingLayer : public ObjectLayer {
119119
}
120120

121121
/// Emit the object.
122-
void emit(std::unique_ptr<MaterializationResponsibility> R,
122+
void emit(MaterializationResponsibility R,
123123
std::unique_ptr<MemoryBuffer> O) override;
124124

125125
/// Instructs this ObjectLinkingLayer instance to override the symbol flags

llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ObjectTransformLayer : public ObjectLayer {
3131
ObjectTransformLayer(ExecutionSession &ES, ObjectLayer &BaseLayer,
3232
TransformFunction Transform = TransformFunction());
3333

34-
void emit(std::unique_ptr<MaterializationResponsibility> R,
34+
void emit(MaterializationResponsibility R,
3535
std::unique_ptr<MemoryBuffer> O) override;
3636

3737
void setTransform(TransformFunction Transform) {

llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class RTDyldObjectLinkingLayer : public ObjectLayer {
5858
~RTDyldObjectLinkingLayer();
5959

6060
/// Emit the object.
61-
void emit(std::unique_ptr<MaterializationResponsibility> R,
61+
void emit(MaterializationResponsibility R,
6262
std::unique_ptr<MemoryBuffer> O) override;
6363

6464
/// Set the NotifyLoaded callback.

llvm/include/llvm/ExecutionEngine/Orc/Speculation.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ class IRSpeculationLayer : public IRLayer {
181181
: IRLayer(ES, BaseLayer.getManglingOptions()), NextLayer(BaseLayer),
182182
S(Spec), Mangle(Mangle), QueryAnalysis(Interpreter) {}
183183

184-
void emit(std::unique_ptr<MaterializationResponsibility> R,
185-
ThreadSafeModule TSM) override;
184+
void emit(MaterializationResponsibility R, ThreadSafeModule TSM) override;
186185

187186
private:
188187
TargetAndLikelies

llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class PartitioningIRMaterializationUnit : public IRMaterializationUnit {
8888
Parent(Parent) {}
8989

9090
private:
91-
void materialize(std::unique_ptr<MaterializationResponsibility> R) override {
91+
void materialize(MaterializationResponsibility R) override {
9292
Parent.emitPartition(std::move(R), std::move(TSM),
9393
std::move(SymbolToDefinition));
9494
}
@@ -128,15 +128,15 @@ void CompileOnDemandLayer::setPartitionFunction(PartitionFunction Partition) {
128128
void CompileOnDemandLayer::setImplMap(ImplSymbolMap *Imp) {
129129
this->AliaseeImpls = Imp;
130130
}
131-
void CompileOnDemandLayer::emit(
132-
std::unique_ptr<MaterializationResponsibility> R, ThreadSafeModule TSM) {
131+
void CompileOnDemandLayer::emit(MaterializationResponsibility R,
132+
ThreadSafeModule TSM) {
133133
assert(TSM && "Null module");
134134

135135
auto &ES = getExecutionSession();
136136

137137
// Sort the callables and non-callables, build re-exports and lodge the
138138
// actual module with the implementation dylib.
139-
auto &PDR = getPerDylibResources(R->getTargetJITDylib());
139+
auto &PDR = getPerDylibResources(R.getTargetJITDylib());
140140

141141
SymbolAliasMap NonCallables;
142142
SymbolAliasMap Callables;
@@ -145,7 +145,7 @@ void CompileOnDemandLayer::emit(
145145
cleanUpModule(M);
146146
});
147147

148-
for (auto &KV : R->getSymbols()) {
148+
for (auto &KV : R.getSymbols()) {
149149
auto &Name = KV.first;
150150
auto &Flags = KV.second;
151151
if (Flags.isCallable())
@@ -158,19 +158,19 @@ void CompileOnDemandLayer::emit(
158158
// implementation dylib.
159159
if (auto Err = PDR.getImplDylib().define(
160160
std::make_unique<PartitioningIRMaterializationUnit>(
161-
ES, *getManglingOptions(), std::move(TSM), R->getVModuleKey(),
161+
ES, *getManglingOptions(), std::move(TSM), R.getVModuleKey(),
162162
*this))) {
163163
ES.reportError(std::move(Err));
164-
R->failMaterialization();
164+
R.failMaterialization();
165165
return;
166166
}
167167

168168
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));
171171
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));
174174
}
175175

176176
CompileOnDemandLayer::PerDylibResources &
@@ -247,7 +247,7 @@ void CompileOnDemandLayer::expandPartition(GlobalValueSet &Partition) {
247247
}
248248

249249
void CompileOnDemandLayer::emitPartition(
250-
std::unique_ptr<MaterializationResponsibility> R, ThreadSafeModule TSM,
250+
MaterializationResponsibility R, ThreadSafeModule TSM,
251251
IRMaterializationUnit::SymbolNameToDefinitionMap Defs) {
252252

253253
// FIXME: Need a 'notify lazy-extracting/emitting' callback to tie the
@@ -257,8 +257,8 @@ void CompileOnDemandLayer::emitPartition(
257257

258258
auto &ES = getExecutionSession();
259259
GlobalValueSet RequestedGVs;
260-
for (auto &Name : R->getRequestedSymbols()) {
261-
if (Name == R->getInitializerSymbol())
260+
for (auto &Name : R.getRequestedSymbols()) {
261+
if (Name == R.getInitializerSymbol())
262262
TSM.withModuleDo([&](Module &M) {
263263
for (auto &GV : getStaticInitGVs(M))
264264
RequestedGVs.insert(&GV);
@@ -285,9 +285,9 @@ void CompileOnDemandLayer::emitPartition(
285285

286286
// If the partition is empty, return the whole module to the symbol table.
287287
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));
291291
return;
292292
}
293293

@@ -308,7 +308,7 @@ void CompileOnDemandLayer::emitPartition(
308308
IRSymbolMapper::add(ES, *getManglingOptions(),
309309
PromotedGlobals, SymbolFlags);
310310

311-
if (auto Err = R->defineMaterializing(SymbolFlags))
311+
if (auto Err = R.defineMaterializing(SymbolFlags))
312312
return std::move(Err);
313313
}
314314

@@ -348,12 +348,12 @@ void CompileOnDemandLayer::emitPartition(
348348

349349
if (!ExtractedTSM) {
350350
ES.reportError(ExtractedTSM.takeError());
351-
R->failMaterialization();
351+
R.failMaterialization();
352352
return;
353353
}
354354

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));
357357
BaseLayer.emit(std::move(R), std::move(*ExtractedTSM));
358358
}
359359

0 commit comments

Comments
 (0)