[Mlir-commits] [mlir] [mlir] Retain original identifier names for debugging v2 (PR #119944)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Dec 13 18:58:57 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 60325abeb3226b17c28429dfa6e175f25c171ec0 28099524777fd7e90ed7073b17baea2708ec356e --extensions cpp,h -- mlir/include/mlir/IR/AsmState.h mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h mlir/lib/AsmParser/Parser.cpp mlir/lib/IR/AsmPrinter.cpp mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index 06b819b4a8..831775fcd7 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -1023,7 +1023,8 @@ static StringRef sanitizeIdentifier(StringRef name, SmallString<16> &buffer,
// Check to see if this name is valid. If it starts with a digit, then it
// could conflict with the autogenerated numeric ID's, so add an underscore
// prefix to avoid problems. This can be overridden by setting allowNumeric.
- if ((isdigit(name[0]) || (!validChar(name[0]) && name[0] != ' ')) && !allowNumeric) {
+ if ((isdigit(name[0]) || (!validChar(name[0]) && name[0] != ' ')) &&
+ !allowNumeric) {
buffer.push_back('_');
copyNameToBuffer();
return buffer;
diff --git a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
index f9f60832a3..9eb6551119 100644
--- a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
+++ b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
@@ -444,9 +444,9 @@ performActions(raw_ostream &os,
// untouched.
PassReproducerOptions reproOptions;
FallbackAsmResourceMap fallbackResourceMap;
- ParserConfig parseConfig(
- context, config.shouldVerifyOnParsing(), &fallbackResourceMap,
- config.shouldRetainIdentifierNames());
+ ParserConfig parseConfig(context, config.shouldVerifyOnParsing(),
+ &fallbackResourceMap,
+ config.shouldRetainIdentifierNames());
if (config.shouldRunReproducer())
reproOptions.attachResourceParser(parseConfig);
``````````
</details>
https://github.com/llvm/llvm-project/pull/119944
More information about the Mlir-commits
mailing list