@@ -35,12 +35,11 @@ class SparcDAGToDAGISel : public SelectionDAGISel {
35
35
// / Subtarget - Keep a pointer to the Sparc Subtarget around so that we can
36
36
// / make the right decision when generating code for different targets.
37
37
const SparcSubtarget *Subtarget = nullptr ;
38
- public:
39
- static char ID;
40
38
39
+ public:
41
40
SparcDAGToDAGISel () = delete ;
42
41
43
- explicit SparcDAGToDAGISel (SparcTargetMachine &tm) : SelectionDAGISel(ID, tm) {}
42
+ explicit SparcDAGToDAGISel (SparcTargetMachine &tm) : SelectionDAGISel(tm) {}
44
43
45
44
bool runOnMachineFunction (MachineFunction &MF) override {
46
45
Subtarget = &MF.getSubtarget <SparcSubtarget>();
@@ -66,11 +65,18 @@ class SparcDAGToDAGISel : public SelectionDAGISel {
66
65
SDNode* getGlobalBaseReg ();
67
66
bool tryInlineAsm (SDNode *N);
68
67
};
68
+
69
+ class SparcDAGToDAGISelLegacy : public SelectionDAGISelLegacy {
70
+ public:
71
+ static char ID;
72
+ explicit SparcDAGToDAGISelLegacy (SparcTargetMachine &tm)
73
+ : SelectionDAGISelLegacy(ID, std::make_unique<SparcDAGToDAGISel>(tm)) {}
74
+ };
69
75
} // end anonymous namespace
70
76
71
- char SparcDAGToDAGISel ::ID = 0 ;
77
+ char SparcDAGToDAGISelLegacy ::ID = 0 ;
72
78
73
- INITIALIZE_PASS (SparcDAGToDAGISel , DEBUG_TYPE, PASS_NAME, false , false )
79
+ INITIALIZE_PASS (SparcDAGToDAGISelLegacy , DEBUG_TYPE, PASS_NAME, false , false )
74
80
75
81
SDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
76
82
Register GlobalBaseReg = Subtarget->getInstrInfo ()->getGlobalBaseReg (MF);
@@ -397,5 +403,5 @@ bool SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(
397
403
// / SPARC-specific DAG, ready for instruction scheduling.
398
404
// /
399
405
FunctionPass *llvm::createSparcISelDag (SparcTargetMachine &TM) {
400
- return new SparcDAGToDAGISel (TM);
406
+ return new SparcDAGToDAGISelLegacy (TM);
401
407
}
0 commit comments