Skip to content

Commit f1a0ff0

Browse files
committed
updated
1 parent 753dd50 commit f1a0ff0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,16 +2375,15 @@ mlir::Value ScalarExprEmitter::VisitExprWithCleanups(ExprWithCleanups *E) {
23752375
builder.getInsertionBlock()};
23762376
auto scopeYieldVal = Visit(E->getSubExpr());
23772377
if (scopeYieldVal) {
2378-
lexScope.ForceCleanup(); // Defers to RunCleanupsScope's dtor and
2379-
// scope handling
2378+
// Defend against dominance problems caused by jumps out of expression
2379+
// evaluation through the shared cleanup block. We do not pass {&V} to
2380+
// ForceCleanup, because the scope returns an rvalue.
2381+
lexScope.ForceCleanup();
23802382
builder.create<cir::YieldOp>(loc, scopeYieldVal);
23812383
yieldTy = scopeYieldVal.getType();
23822384
}
23832385
});
23842386

2385-
// Defend against dominance problems caused by jumps out of expression
2386-
// evaluation through the shared cleanup block.
2387-
// TODO(cir): Scope.ForceCleanup({&V});
23882387
return scope.getNumResults() > 0 ? scope->getResult(0) : nullptr;
23892388
}
23902389

0 commit comments

Comments
 (0)