================
@@ -149,14 +156,125 @@ void CIRGenFunction::declare(mlir::Value addrVal, const 
Decl *var, QualType ty,
     allocaOp.setConstantAttr(mlir::UnitAttr::get(&getMLIRContext()));
 }
 
+void CIRGenFunction::LexicalScope::cleanup() {
+  CIRGenBuilderTy &builder = cgf.builder;
+  LexicalScope *localScope = cgf.currLexScope;
+
+  if (returnBlock != nullptr) {
+    // Write out the return block, which loads the value from `__retval` and
+    // issues the `cir.return`.
+    mlir::OpBuilder::InsertionGuard guard(builder);
+    builder.setInsertionPointToEnd(returnBlock);
+    (void)emitReturn(*returnLoc);
+  }
+
+  mlir::Block *currBlock = builder.getBlock();
----------------
erichkeane wrote:

```suggestion
  mlir::Block *curBlock = builder.getBlock();
```

I've never seen someone shorted 'current' to 'curr' before :D  Typically 
throughout clang we use `Cur` instead of `Curr`.

https://github.com/llvm/llvm-project/pull/131945
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to