[Mlir-commits] [mlir] [mlir] Add example of `printAlias` to test dialect (NFC) (PR #79232)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jan 23 16:15:54 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 50df08cd43ec02c58067797df33ec67c128431bb cee91f0f7e591ffe85ea6fd84f4799a205638385 -- mlir/test/lib/Dialect/Test/TestAttributes.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/test/lib/Dialect/Test/TestAttributes.cpp b/mlir/test/lib/Dialect/Test/TestAttributes.cpp
index 1628da46de..8819f6cbe9 100644
--- a/mlir/test/lib/Dialect/Test/TestAttributes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestAttributes.cpp
@@ -220,7 +220,8 @@ llvm::hash_code hash_value(const test::CopyCount ©Count) {
// TestConditionalAliasAttr
//===----------------------------------------------------------------------===//
-/// Attempt to parse the conditionally-aliased string attribute as a keyword or string, else try to parse an alias.
+/// Attempt to parse the conditionally-aliased string attribute as a keyword or
+/// string, else try to parse an alias.
static ParseResult parseConditionalAlias(AsmParser &p, StringAttr &value) {
std::string str;
if (succeeded(p.parseOptionalKeywordOrString(&str))) {
@@ -230,11 +231,12 @@ static ParseResult parseConditionalAlias(AsmParser &p, StringAttr &value) {
return p.parseAttribute(value);
}
-/// Print the string attribute as an alias if it has one, otherwise print it as a keyword if possible.
+/// Print the string attribute as an alias if it has one, otherwise print it as
+/// a keyword if possible.
static void printConditionalAlias(AsmPrinter &p, StringAttr value) {
- if (succeeded(p.printAlias(value)))
- return;
- p.printKeywordOrString(value);
+ if (succeeded(p.printAlias(value)))
+ return;
+ p.printKeywordOrString(value);
}
//===----------------------------------------------------------------------===//
``````````
</details>
https://github.com/llvm/llvm-project/pull/79232
More information about the Mlir-commits
mailing list