[llvm] [CodeGen] Port WasmEHPrepare to new pass manager (PR #74435)
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 5 16:51:41 PST 2023
================
@@ -113,19 +116,41 @@ class WasmEHPrepare : public FunctionPass {
bool prepareEHPads(Function &F);
void prepareEHPad(BasicBlock *BB, bool NeedPersonality, unsigned Index = 0);
+public:
+ WasmEHPrepareImpl() = default;
+ WasmEHPrepareImpl(Type *LPadContextTy_) : LPadContextTy(LPadContextTy_) {}
+ bool runOnFunction(Function &F);
+};
+
+class WasmEHPrepare : public FunctionPass {
+ WasmEHPrepareImpl P;
+
public:
static char ID; // Pass identification, replacement for typeid
WasmEHPrepare() : FunctionPass(ID) {}
bool doInitialization(Module &M) override;
- bool runOnFunction(Function &F) override;
+ bool runOnFunction(Function &F) override { return P.runOnFunction(F); }
StringRef getPassName() const override {
return "WebAssembly Exception handling preparation";
}
};
+
} // end anonymous namespace
+PreservedAnalyses WasmEHPreparePass::run(Function &F,
+ FunctionAnalysisManager &) {
+ auto &Context = F.getContext();
----------------
aheejin wrote:
Then we should delete the current `doInitialization`. But then where do we do stuff that was only possible in `doInitialization` before, like things listed here? https://llvm.org/docs/WritingAnLLVMPass.html#the-doinitialization-module-method
https://github.com/llvm/llvm-project/pull/74435
More information about the llvm-commits
mailing list