-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MLIR][BUILD] Fix Unicode build issue on Windows. #112300
Conversation
@llvm/pr-subscribers-mlir-core @llvm/pr-subscribers-mlir Author: Harrison Hao (harrisonGPU) ChangesThis issue is from #77668. I encountered a build issue because it used Unicode. When I built MLIR on Windows with Visual Studio 2022, I faced a build failure. Full diff: https://github.com/llvm/llvm-project/pull/112300.diff 1 Files Affected:
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();
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SG from me
} else { | ||
rewriteState.insertText(nameRange.Start, "〔"); | ||
rewriteState.insertText(nameRange.End, "〕"); | ||
rewriteState.insertText(nameRange.Start, " ["); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets perhaps make this something like " ![" and "]! " - previously one could differentiate between generic or not form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I have already updated it.
b0daa74
to
cde0eba
Compare
Hi @jpienaar , I have updated this PR, please take a look again. :) |
This issue is from #77668. I encountered a build issue because it used Unicode. When I built MLIR on Windows with Visual Studio 2022, I faced a build failure.