@@ -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) {}
@@ -385,7 +389,7 @@ class RegisterCoalescer : private LiveRangeEdit::Delegate {
385
389
};
386
390
387
391
class RegisterCoalescerLegacy : public MachineFunctionPass {
388
- std::unique_ptr< RegisterCoalescer> Impl;
392
+ RegisterCoalescer Impl;
389
393
390
394
public:
391
395
static char ID; // /< Class identification, replacement for typeinfo
@@ -401,7 +405,7 @@ class RegisterCoalescerLegacy : public MachineFunctionPass {
401
405
MachineFunctionProperties::Property::IsSSA);
402
406
}
403
407
404
- void releaseMemory () override { Impl-> releaseMemory (); }
408
+ void releaseMemory () override { Impl. releaseMemory (); }
405
409
406
410
// / This is the pass entry point.
407
411
bool runOnMachineFunction (MachineFunction &) override ;
@@ -4272,8 +4276,8 @@ bool RegisterCoalescerLegacy::runOnMachineFunction(MachineFunction &MF) {
4272
4276
auto *Loops = &getAnalysis<MachineLoopInfoWrapperPass>().getLI ();
4273
4277
auto *SIWrapper = getAnalysisIfAvailable<SlotIndexesWrapperPass>();
4274
4278
SlotIndexes *SI = SIWrapper ? &SIWrapper->getSI () : nullptr ;
4275
- Impl. reset ( new RegisterCoalescer (LIS, SI, Loops) );
4276
- return Impl-> run (MF);
4279
+ Impl = RegisterCoalescer (LIS, SI, Loops);
4280
+ return Impl. run (MF);
4277
4281
}
4278
4282
4279
4283
bool RegisterCoalescer::run (MachineFunction &fn) {
0 commit comments