[llvm] [SandboxIR] Implement LandingPadInst (PR #106116)

Sriraman Tallam via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 13:30:50 PDT 2024


================
@@ -1888,6 +1890,50 @@ class CallBrInst final : public CallBase {
   }
 };
 
+class LandingPadInst : public SingleLLVMInstructionImpl<llvm::LandingPadInst> {
+  LandingPadInst(llvm::LandingPadInst *LP, Context &Ctx)
+      : SingleLLVMInstructionImpl(ClassID::LandingPad, Opcode::LandingPad, LP,
+                                  Ctx) {}
+  friend class Context; // For constructor.
+
+public:
+  static LandingPadInst *create(Type *RetTy, unsigned NumReservedClauses,
+                                BBIterator WhereIt, BasicBlock *WhereBB,
+                                Context &Ctx, const Twine &Name = "");
+  /// Return 'true' if this landingpad instruction is a
+  /// cleanup. I.e., it should be run when unwinding even if its landing pad
+  /// doesn't catch the exception.
+  bool isCleanup() const {
+    return cast<llvm::LandingPadInst>(Val)->isCleanup();
+  }
+  /// Indicate that this landingpad instruction is a cleanup.
+  void setCleanup(bool V);
+
+  // TODO: We are not implementing addClause() because we have no way to revert
+  // it for now.
----------------
tmsri wrote:

This seems fine for now as the vectorizer will never have to  add/remove catch and filters?  

https://github.com/llvm/llvm-project/pull/106116


More information about the llvm-commits mailing list