Skip to content

Commit e4efe1c

Browse files
committed
WebAssembly part
1 parent 0dc205a commit e4efe1c

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

llvm/lib/Target/WebAssembly/WebAssembly.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void initializeWebAssemblyArgumentMovePass(PassRegistry &);
6767
void initializeWebAssemblyCleanCodeAfterTrapPass(PassRegistry &);
6868
void initializeWebAssemblyCFGSortPass(PassRegistry &);
6969
void initializeWebAssemblyCFGStackifyPass(PassRegistry &);
70-
void initializeWebAssemblyDAGToDAGISelPass(PassRegistry &);
70+
void initializeWebAssemblyDAGToDAGISelLegacyPass(PassRegistry &);
7171
void initializeWebAssemblyDebugFixupPass(PassRegistry &);
7272
void initializeWebAssemblyExceptionInfoPass(PassRegistry &);
7373
void initializeWebAssemblyExplicitLocalsPass(PassRegistry &);

llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ class WebAssemblyDAGToDAGISel final : public SelectionDAGISel {
4242
const WebAssemblySubtarget *Subtarget;
4343

4444
public:
45-
static char ID;
46-
4745
WebAssemblyDAGToDAGISel() = delete;
4846

4947
WebAssemblyDAGToDAGISel(WebAssemblyTargetMachine &TM,
5048
CodeGenOptLevel OptLevel)
51-
: SelectionDAGISel(ID, TM, OptLevel), Subtarget(nullptr) {}
49+
: SelectionDAGISel(TM, OptLevel), Subtarget(nullptr) {}
5250

5351
bool runOnMachineFunction(MachineFunction &MF) override {
5452
LLVM_DEBUG(dbgs() << "********** ISelDAGToDAG **********\n"
@@ -82,11 +80,21 @@ class WebAssemblyDAGToDAGISel final : public SelectionDAGISel {
8280
bool SelectAddrAddOperands(MVT OffsetType, SDValue N, SDValue &Offset,
8381
SDValue &Addr);
8482
};
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+
};
8592
} // end anonymous namespace
8693

87-
char WebAssemblyDAGToDAGISel::ID;
94+
char WebAssemblyDAGToDAGISelLegacy::ID;
8895

89-
INITIALIZE_PASS(WebAssemblyDAGToDAGISel, DEBUG_TYPE, PASS_NAME, false, false)
96+
INITIALIZE_PASS(WebAssemblyDAGToDAGISelLegacy, DEBUG_TYPE, PASS_NAME, false,
97+
false)
9098

9199
void WebAssemblyDAGToDAGISel::PreprocessISelDAG() {
92100
// Stack objects that should be allocated to locals are hoisted to WebAssembly
@@ -409,5 +417,5 @@ bool WebAssemblyDAGToDAGISel::SelectAddrOperands64(SDValue Op, SDValue &Offset,
409417
/// for instruction scheduling.
410418
FunctionPass *llvm::createWebAssemblyISelDag(WebAssemblyTargetMachine &TM,
411419
CodeGenOptLevel OptLevel) {
412-
return new WebAssemblyDAGToDAGISel(TM, OptLevel);
420+
return new WebAssemblyDAGToDAGISelLegacy(TM, OptLevel);
413421
}

llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTarget() {
9090
initializeWebAssemblyMCLowerPrePassPass(PR);
9191
initializeWebAssemblyLowerRefTypesIntPtrConvPass(PR);
9292
initializeWebAssemblyFixBrTableDefaultsPass(PR);
93-
initializeWebAssemblyDAGToDAGISelPass(PR);
93+
initializeWebAssemblyDAGToDAGISelLegacyPass(PR);
9494
}
9595

9696
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)