[clang] [CIR] Upstream support co_return of values from co_await (PR #173174)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 13 18:21:30 PST 2026
================
@@ -737,7 +722,21 @@ void AggExprEmitter::VisitLambdaExpr(LambdaExpr *e) {
void AggExprEmitter::VisitExprWithCleanups(ExprWithCleanups *e) {
CIRGenFunction::RunCleanupsScope cleanups(cgf);
- Visit(e->getSubExpr());
+ auto &builder = cgf.getBuilder();
+ auto scopeLoc = cgf.getLoc(e->getSourceRange());
+ mlir::OpBuilder::InsertPoint scopeBegin;
+ cir::ScopeOp::create(builder, scopeLoc, /*scopeBuilder=*/
+ [&](mlir::OpBuilder &b, mlir::Location loc) {
+ scopeBegin = b.saveInsertionPoint();
+ });
+
+ {
+ mlir::OpBuilder::InsertionGuard guard(builder);
+ builder.restoreInsertionPoint(scopeBegin);
+ CIRGenFunction::LexicalScope lexScope{cgf, scopeLoc,
----------------
Andres-Salamanca wrote:
Done
https://github.com/llvm/llvm-project/pull/173174
More information about the cfe-commits
mailing list