@@ -42,13 +42,11 @@ class WebAssemblyDAGToDAGISel final : public SelectionDAGISel {
42
42
const WebAssemblySubtarget *Subtarget;
43
43
44
44
public:
45
- static char ID;
46
-
47
45
WebAssemblyDAGToDAGISel () = delete ;
48
46
49
47
WebAssemblyDAGToDAGISel (WebAssemblyTargetMachine &TM,
50
48
CodeGenOptLevel OptLevel)
51
- : SelectionDAGISel(ID, TM, OptLevel), Subtarget(nullptr ) {}
49
+ : SelectionDAGISel(TM, OptLevel), Subtarget(nullptr ) {}
52
50
53
51
bool runOnMachineFunction (MachineFunction &MF) override {
54
52
LLVM_DEBUG (dbgs () << " ********** ISelDAGToDAG **********\n "
@@ -82,11 +80,21 @@ class WebAssemblyDAGToDAGISel final : public SelectionDAGISel {
82
80
bool SelectAddrAddOperands (MVT OffsetType, SDValue N, SDValue &Offset,
83
81
SDValue &Addr);
84
82
};
83
+
84
+ class WebAssemblyDAGToDAGISelLegacy : public SelectionDAGISelLegacy {
85
+ public:
86
+ static char ID;
87
+ explicit WebAssemblyDAGToDAGISelLegacy (WebAssemblyTargetMachine &TM,
88
+ CodeGenOptLevel OptLevel)
89
+ : SelectionDAGISelLegacy(
90
+ ID, std::make_unique<WebAssemblyDAGToDAGISel>(TM, OptLevel)) {}
91
+ };
85
92
} // end anonymous namespace
86
93
87
- char WebAssemblyDAGToDAGISel ::ID;
94
+ char WebAssemblyDAGToDAGISelLegacy ::ID;
88
95
89
- INITIALIZE_PASS (WebAssemblyDAGToDAGISel, DEBUG_TYPE, PASS_NAME, false , false )
96
+ INITIALIZE_PASS (WebAssemblyDAGToDAGISelLegacy, DEBUG_TYPE, PASS_NAME, false ,
97
+ false )
90
98
91
99
void WebAssemblyDAGToDAGISel::PreprocessISelDAG() {
92
100
// Stack objects that should be allocated to locals are hoisted to WebAssembly
@@ -409,5 +417,5 @@ bool WebAssemblyDAGToDAGISel::SelectAddrOperands64(SDValue Op, SDValue &Offset,
409
417
// / for instruction scheduling.
410
418
FunctionPass *llvm::createWebAssemblyISelDag (WebAssemblyTargetMachine &TM,
411
419
CodeGenOptLevel OptLevel) {
412
- return new WebAssemblyDAGToDAGISel (TM, OptLevel);
420
+ return new WebAssemblyDAGToDAGISelLegacy (TM, OptLevel);
413
421
}
0 commit comments