[Mlir-commits] [mlir] [MLIR][BUILD] Fix Unicode build issue on Windows. (PR #112300)

Harrison Hao llvmlistbot at llvm.org
Tue Oct 15 18:23:38 PDT 2024


https://github.com/harrisonGPU updated https://github.com/llvm/llvm-project/pull/112300

>From 76e6ecfb4c49484f5b4ecde80546bde2a0025536 Mon Sep 17 00:00:00 2001
From: Harrison Hao <harrison.hao at amd.com>
Date: Tue, 15 Oct 2024 11:28:42 +0800
Subject: [PATCH 1/2] [MLIR][BUILD] Fix Unicode build issue on Windows.

---
 mlir/tools/mlir-rewrite/mlir-rewrite.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
index 308e6490726c86..5e3044aa40569b 100644
--- a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
+++ b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
@@ -320,25 +320,25 @@ LogicalResult markRanges(RewritePad &rewriteState, raw_ostream &os) {
   for (auto it : rewriteState.getOpDefs()) {
     auto [startOp, endOp] = getOpRange(it);
 
-    rewriteState.insertText(startOp, "《");
-    rewriteState.insertText(endOp, "》");
+    rewriteState.insertText(startOp, " <");
+    rewriteState.insertText(endOp, "> ");
 
     auto nameRange = getOpNameRange(it);
 
     if (isGeneric(it)) {
-      rewriteState.insertText(nameRange.Start, "〖");
-      rewriteState.insertText(nameRange.End, "〗");
+      rewriteState.insertText(nameRange.Start, " [");
+      rewriteState.insertText(nameRange.End, "] ");
     } else {
-      rewriteState.insertText(nameRange.Start, "〔");
-      rewriteState.insertText(nameRange.End, "〕");
+      rewriteState.insertText(nameRange.Start, " [");
+      rewriteState.insertText(nameRange.End, "] ");
     }
   }
 
   // Highlight all comment lines.
   // TODO: Could be replaced if this is kept in memory.
   for (auto commentLine : rewriteState.getSingleLineComments()) {
-    rewriteState.insertText(commentLine.Start, "❰");
-    rewriteState.insertText(commentLine.End, "❱");
+    rewriteState.insertText(commentLine.Start, "{");
+    rewriteState.insertText(commentLine.End, "}");
   }
 
   return success();

>From b0daa743dd142d6d3525a4f17d22eb5a379a17dd Mon Sep 17 00:00:00 2001
From: Harrison Hao <tsworld1314 at gmail.com>
Date: Wed, 16 Oct 2024 01:19:43 +0000
Subject: [PATCH 2/2] [MLIR][BUILD] Update code for comments.

---
 mlir/tools/mlir-rewrite/mlir-rewrite.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
index 5e3044aa40569b..3da97465f8634d 100644
--- a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
+++ b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
@@ -329,8 +329,8 @@ LogicalResult markRanges(RewritePad &rewriteState, raw_ostream &os) {
       rewriteState.insertText(nameRange.Start, " [");
       rewriteState.insertText(nameRange.End, "] ");
     } else {
-      rewriteState.insertText(nameRange.Start, " [");
-      rewriteState.insertText(nameRange.End, "] ");
+      rewriteState.insertText(nameRange.Start, " ![");
+      rewriteState.insertText(nameRange.End, "]! ");
     }
   }
 



More information about the Mlir-commits mailing list