[Mlir-commits] [mlir] ecf979c - [mlir] [docs] fix toy readme (#172262)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Dec 19 00:41:49 PST 2025


Author: hellozmz
Date: 2025-12-19T09:41:44+01:00
New Revision: ecf979cdb638331a8b059abe0af2d04f6d3eceb2

URL: https://github.com/llvm/llvm-project/commit/ecf979cdb638331a8b059abe0af2d04f6d3eceb2
DIFF: https://github.com/llvm/llvm-project/commit/ecf979cdb638331a8b059abe0af2d04f6d3eceb2.diff

LOG: [mlir] [docs] fix toy readme (#172262)

mlir toy docs use the deprecated api, so I fix it.

Added: 
    

Modified: 
    mlir/docs/Tutorials/Toy/Ch-6.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Tutorials/Toy/Ch-6.md b/mlir/docs/Tutorials/Toy/Ch-6.md
index 178c07338ac45..13c28c6cb8dff 100644
--- a/mlir/docs/Tutorials/Toy/Ch-6.md
+++ b/mlir/docs/Tutorials/Toy/Ch-6.md
@@ -34,7 +34,7 @@ static FlatSymbolRefAttr getOrInsertPrintf(PatternRewriter &rewriter,
                                            LLVM::LLVMDialect *llvmDialect) {
   auto *context = module.getContext();
   if (module.lookupSymbol<LLVM::LLVMFuncOp>("printf"))
-    return SymbolRefAttr::get("printf", context);
+    return SymbolRefAttr::get(context, "printf");
 
   // Create a function declaration for printf, the signature is:
   //   * `i32 (i8*, ...)`
@@ -48,7 +48,7 @@ static FlatSymbolRefAttr getOrInsertPrintf(PatternRewriter &rewriter,
   PatternRewriter::InsertionGuard insertGuard(rewriter);
   rewriter.setInsertionPointToStart(module.getBody());
   LLVM::LLVMFuncOp::create(rewriter, module.getLoc(), "printf", llvmFnType);
-  return SymbolRefAttr::get("printf", context);
+  return SymbolRefAttr::get(context, "printf");
 }
 ```
 


        


More information about the Mlir-commits mailing list