================
@@ -25,6 +25,52 @@
 using namespace clang;
 using namespace clang::CIRGen;
 
+void CallLifetimeEnd::emit(CIRGenFunction &cgf, Flags flags) {
+  cgf.emitLifetimeEndOp(addr.getLoc(), addr);
+}
+
+void CIRGenFunction::pushFullExprLifetimeEnd(Address addr) {
+  assert(addr.getDefiningOp<cir::AllocaOp>() &&
+         "lifetime cleanup requires the raw alloca address");
+  if (!isInConditionalBranch()) {
+    ehStack.pushCleanup<CallLifetimeEnd>(NormalEHLifetimeMarker,
+                                         addr.getPointer());
+    return;
+  }
+
+  Address activeFlag = createCleanupActiveFlag();
+  deferredConditionalCleanupStack.push_back(
----------------
E00N777 wrote:

I added some test cases for conditional expressions && non-trivial destructors.

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

Reply via email to