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