================
@@ -725,21 +725,105 @@ class CIRTernaryOpFlattening : public
mlir::OpRewritePattern<cir::TernaryOp> {
}
};
+// Get or create the cleanup destination slot for a function. This slot is
+// shared across all cleanup scopes in the function to track which exit path
+// to take after running cleanup code when there are multiple exits.
+static cir::AllocaOp getOrCreateCleanupDestSlot(cir::FuncOp funcOp,
+ mlir::PatternRewriter
&rewriter,
+ mlir::Location loc) {
+ mlir::Block &entryBlock = funcOp.getBody().front();
+
+ // Look for an existing cleanup dest slot in the entry block.
+ for (auto &op : entryBlock) {
----------------
erichkeane wrote:
```suggestion
for (Operation &op : entryBlock) {
```
??
https://github.com/llvm/llvm-project/pull/180627
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits