File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -613,6 +613,10 @@ void CIRGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) {
613
613
// Emit the EH cleanup if required.
614
614
if (RequiresEHCleanup) {
615
615
cir::TryOp tryOp = ehEntry->getParentOp ()->getParentOfType <cir::TryOp>();
616
+
617
+ if (EHParent == EHStack.stable_end () && !tryOp)
618
+ return ;
619
+
616
620
auto *nextAction = getEHDispatchBlock (EHParent, tryOp);
617
621
(void )nextAction;
618
622
Original file line number Diff line number Diff line change @@ -339,3 +339,37 @@ void bar() {
339
339
// CIR: cir.store %[[V3]], %[[V1]] : !s32i, !cir.ptr<!s32i>
340
340
// CIR: cir.call @_ZN1AD2Ev(%[[V0]]) : (!cir.ptr<!ty_A>) -> () extra(#fn_attr)
341
341
// CIR: cir.return
342
+
343
+ class C {
344
+ public:
345
+ ~C ();
346
+ void operator =(C);
347
+ };
348
+
349
+ void d () {
350
+ C a, b;
351
+ a = b;
352
+ }
353
+
354
+ // CIR: %[[V0:.*]] = cir.alloca !ty_C, !cir.ptr<!ty_C>, ["a"] {alignment = 1 : i64}
355
+ // CIR: %[[V1:.*]] = cir.alloca !ty_C, !cir.ptr<!ty_C>, ["b"] {alignment = 1 : i64}
356
+ // CIR: cir.scope {
357
+ // CIR: %[[V2:.*]] = cir.alloca !ty_C, !cir.ptr<!ty_C>, ["agg.tmp0"] {alignment = 1 : i64}
358
+ // CIR: cir.call @_ZN1CC2ERKS_(%[[V2]], %[[V1]]) : (!cir.ptr<!ty_C>, !cir.ptr<!ty_C>) -> () extra(#fn_attr)
359
+ // CIR: %[[V3:.*]] = cir.load %[[V2]] : !cir.ptr<!ty_C>, !ty_C
360
+ // CIR: cir.try synthetic cleanup {
361
+ // CIR: cir.call exception @_ZN1CaSES_(%[[V0]], %[[V3]]) : (!cir.ptr<!ty_C>, !ty_C) -> () cleanup {
362
+ // CIR: cir.call @_ZN1CD1Ev(%[[V2]]) : (!cir.ptr<!ty_C>) -> () extra(#fn_attr)
363
+ // CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr<!ty_C>) -> () extra(#fn_attr)
364
+ // CIR: cir.yield
365
+ // CIR: }
366
+ // CIR: cir.yield
367
+ // CIR: } catch [#cir.unwind {
368
+ // CIR: cir.resume
369
+ // CIR: }]
370
+ // CIR: cir.call @_ZN1CD1Ev(%[[V2]]) : (!cir.ptr<!ty_C>) -> () extra(#fn_attr)
371
+ // CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr<!ty_C>) -> () extra(#fn_attr)
372
+ // CIR: }
373
+ // CIR: cir.call @_ZN1CD1Ev(%[[V1]]) : (!cir.ptr<!ty_C>) -> () extra(#fn_attr)
374
+ // CIR: cir.call @_ZN1CD1Ev(%[[V0]]) : (!cir.ptr<!ty_C>) -> () extra(#fn_attr)
375
+ // CIR: cir.return
You can’t perform that action at this time.
0 commit comments