[clang] [CIR] Don't create EH paths for lifetime-marker-only cleanups (PR #224829)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 11:08:00 PDT 2026


================
@@ -341,4 +333,94 @@ void catch_by_value() {
 // LLVM-EH:         call void @__cxa_end_catch()
 // LLVM-EH:         call void @llvm.lifetime.end.p0(ptr %[[C]])
 
+// An enclosing catch requires an unwind edge and the marker must run before
+// entering the handler.
+void lifetime_in_try() {
+  try {
+    int x = 1;
+    may_throw();
+    use(x);
+  } catch (...) {
+  }
+}
+
----------------
andykaylor wrote:

Can you add CIR-EH checks for the new functions?

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


More information about the cfe-commits mailing list