================
@@ -207,36 +215,59 @@ void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF,
         // Push a cleanup for __finally blocks.
         CGF.pushSEHCleanup(NormalAndEHCleanup, FinallyFunc);
     }
+  }
 
 
   // Emit the try body.
   CGF.EmitStmt(S.getTryBody());
 
   // Leave the try.
+  llvm::BasicBlock* dispatchBlock{};
   if (S.getNumCatchStmts())
-    CGF.popCatchScope();
+    dispatchBlock = CGF.popCatchScope();
 
   // Remember where we were.
   CGBuilderTy::InsertPoint SavedIP = CGF.Builder.saveAndClearIP();
 
+  // Wasm uses Windows-style EH instructions, but merges all catch clauses into
----------------
aheejin wrote:

+1 on finding a way to reuse the same code in `CGException.cpp`. I'm not 
familiar with his `CGObjRuntime.cpp`, but can't ObjC (at least partly) use 
functions in `CGException.cpp`? What's the reason ObjC maintains separate EH 
handling routines?

https://github.com/llvm/llvm-project/pull/171038
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to