================
@@ -242,12 +242,15 @@ void CIRGenFunction::LexicalScope::cleanup() {
}
};
- if (returnBlock != nullptr) {
- // Write out the return block, which loads the value from `__retval` and
- // issues the `cir.return`.
+ // Cleanup are done right before codegen resumes a scope. This is where
+ // objects are destroyed. Process all return blocks.
----------------
mmha wrote:
Thanks for pointing this out. I'll update the comment to reflect this. The code
you linked wouldn't work here as this would mean branching out of the case
region, so all the cleanup code would have to be emitted for every early exit.
Not great. Maybe we should leave this as a TODO until we get early exits in
MLIR unless this blocks us from anything important.
https://github.com/llvm/llvm-project/pull/164468
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits