@@ -376,6 +376,10 @@ class RegisterCoalescer : private LiveRangeEdit::Delegate {
376
376
LiveRange &RegRange, JoinVals &Vals2);
377
377
378
378
public:
379
+ // For legacy pass only.
380
+ RegisterCoalescer () {}
381
+ RegisterCoalescer &operator =(RegisterCoalescer &&Other) = default ;
382
+
379
383
RegisterCoalescer (LiveIntervals *LIS, SlotIndexes *SI,
380
384
const MachineLoopInfo *Loops)
381
385
: LIS(LIS), SI(SI), Loops(Loops) {}
@@ -386,7 +390,7 @@ class RegisterCoalescer : private LiveRangeEdit::Delegate {
386
390
};
387
391
388
392
class RegisterCoalescerLegacy : public MachineFunctionPass {
389
- std::unique_ptr< RegisterCoalescer> Impl;
393
+ RegisterCoalescer Impl;
390
394
391
395
public:
392
396
static char ID; // /< Class identification, replacement for typeinfo
@@ -402,14 +406,14 @@ class RegisterCoalescerLegacy : public MachineFunctionPass {
402
406
MachineFunctionProperties::Property::IsSSA);
403
407
}
404
408
405
- void releaseMemory () override { Impl-> releaseMemory (); }
409
+ void releaseMemory () override { Impl. releaseMemory (); }
406
410
407
411
// / This is the pass entry point.
408
412
bool runOnMachineFunction (MachineFunction &) override ;
409
413
410
414
// / Implement the dump method.
411
415
void print (raw_ostream &O, const Module * = nullptr ) const override {
412
- Impl-> print (O, nullptr );
416
+ Impl. print (O, nullptr );
413
417
}
414
418
};
415
419
@@ -4278,8 +4282,8 @@ bool RegisterCoalescerLegacy::runOnMachineFunction(MachineFunction &MF) {
4278
4282
auto *Loops = &getAnalysis<MachineLoopInfoWrapperPass>().getLI ();
4279
4283
auto *SIWrapper = getAnalysisIfAvailable<SlotIndexesWrapperPass>();
4280
4284
SlotIndexes *SI = SIWrapper ? &SIWrapper->getSI () : nullptr ;
4281
- Impl. reset ( new RegisterCoalescer (LIS, SI, Loops) );
4282
- return Impl-> run (MF);
4285
+ Impl = RegisterCoalescer (LIS, SI, Loops);
4286
+ return Impl. run (MF);
4283
4287
}
4284
4288
4285
4289
bool RegisterCoalescer::run (MachineFunction &fn) {
0 commit comments