[Mlir-commits] [mlir] Reformat whitespace in dependent dialects codegen (PR #78090)

Markus Böck llvmlistbot at llvm.org
Sun Jan 14 08:52:13 PST 2024


================
@@ -284,9 +283,12 @@ static void emitDialectDef(Dialect &dialect, raw_ostream &os) {
   std::string dependentDialectRegistrations;
   {
     llvm::raw_string_ostream dialectsOs(dependentDialectRegistrations);
-    for (StringRef dependentDialect : dialect.getDependentDialects())
-      dialectsOs << llvm::formatv(dialectRegistrationTemplate,
-                                  dependentDialect);
+    llvm::interleave(
+        dialect.getDependentDialects(), dialectsOs,
+        [&dialectsOs](StringRef dd) {
----------------
zero9178 wrote:

```suggestion
        [&](StringRef dependentDialect) {
```
ulta nit: Using capture all is more consistent with the rest of the codebase. I personally prefer the old variable name for the iterator as well. Ditto in the other diffs. 

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


More information about the Mlir-commits mailing list