[llvm] [SandboxIR] Remove tight-coupling with LLVM's SwitchInst::CaseHandle (PR #167093)

via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 8 13:03:56 PST 2025


================
@@ -1884,45 +1884,96 @@ class SwitchInst : public SingleLLVMInstructionImpl<llvm::SwitchInst> {
     return cast<llvm::SwitchInst>(Val)->getNumCases();
   }
 
-  using CaseHandle =
-      llvm::SwitchInst::CaseHandleImpl<SwitchInst, ConstantInt, BasicBlock>;
-  using ConstCaseHandle =
-      llvm::SwitchInst::CaseHandleImpl<const SwitchInst, const ConstantInt,
-                                       const BasicBlock>;
-  using CaseIt = llvm::SwitchInst::CaseIteratorImpl<CaseHandle>;
-  using ConstCaseIt = llvm::SwitchInst::CaseIteratorImpl<ConstCaseHandle>;
+  class CaseIt;
+  class CaseHandle {
+    Context &Ctx;
+    llvm::SwitchInst::CaseIt LLVMCaseIt;
+    friend class CaseIt;
+
+  public:
+    CaseHandle(Context &Ctx, llvm::SwitchInst::CaseIt LLVMCaseIt)
+        : Ctx(Ctx), LLVMCaseIt(LLVMCaseIt) {}
+    LLVM_ABI ConstantInt *getCaseValue() const;
----------------
vporpo wrote:

I dropped it.

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


More information about the llvm-commits mailing list