[llvm] [CodeGen] Port WasmEHPrepare to new pass manager (PR #74435)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 5 20:55:36 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();
+ auto *I32Ty = Type::getInt32Ty(Context);
+ auto *PtrTy = PointerType::get(Context, F.getAddressSpace());
----------------
paperchalice wrote:
Checked existing code, the address space is 0 here, will update later.
https://github.com/llvm/llvm-project/pull/74435
More information about the llvm-commits
mailing list