rsmith added inline comments.
================ Comment at: lib/CodeGen/CGCoroutine.cpp:273 + + // FIXME: There must be a cleaner way to do this! + if (auto *Cleanup = dyn_cast_or_null<EHCleanupScope>(&*CGF.EHStack.begin())) { ---------------- It doesn't seem safe to assume that a prior `EHCleanupScope` would be for the GRO variable, nor that it can only have one such cleanup. How about this: grab a stable EHStack iterator before you emit cleanups, grab another afterwards, and iterate over the cleanups in that range modifying them as appropriate. Even that seems a bit fragile, though. Would it be feasible to thread the 'active' flag through `EmitAutoVarCleanups` (perhaps add it to `AutoVarEmission`)? https://reviews.llvm.org/D31670 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits