[clang] [CIR] Support aggregate co_await / co_yield in AggExprEmitter (PR #225412)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 19:12:35 PDT 2026


================
@@ -744,6 +739,12 @@ static RValue emitSuspendExpr(CIRGenFunction &cgf,
   RValue rval;
   mlir::Location scopeLoc = cgf.getLoc(e.getSourceRange());
 
+  if (!ignoreResult && aggSlot.isIgnored() &&
----------------
bcardosolopes wrote:

Which caller reaches this? From `AggExprEmitter` you pass `dest.isIgnored()` as `ignoreResult`, so `!ignoreResult && aggSlot.isIgnored()` is always false, and `emitAnyExpr` already creates the temp before it calls `emitAggExpr`. The scalar and complex callers never have an aggregate type.

I get why you'd want it here, a temp created inside the resume region wouldn't dominate uses after the `cir.await`. But if nothing can hit it, either drop it or make it an assert, otherwise it reads like a path the tests cover.

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


More information about the cfe-commits mailing list