[Mlir-commits] [mlir] [MLIR] NFC: Change dyn_cast to isa to prevent warning (PR #81899)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Feb 15 10:48:53 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-mlir-core
Author: Kiran Chandramohan (kiranchandramohan)
<details>
<summary>Changes</summary>
This is to avoid warnings when invoked from the flang documentation generation build.
The warning can be seen in the CI (https://lab.llvm.org/buildbot/#/builders/89/builds/57451).
```
/home/buildbot/as-worker-4/publish-sphinx-docs/llvm-project/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp:2956:38: warning: unused variable ‘operand’ [-Wunused-variable]
```
---
Full diff: https://github.com/llvm/llvm-project/pull/81899.diff
1 Files Affected:
- (modified) mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp (+1-2)
``````````diff
diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index 71326049af0579..0d81912afb6158 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -2953,8 +2953,7 @@ void OpEmitter::buildParamList(SmallVectorImpl<MethodParameter> ¶mList,
operand->isOptional());
continue;
}
- if ([[maybe_unused]] const auto *operand =
- llvm::dyn_cast_if_present<NamedProperty *>(arg)) {
+ if (llvm::isa_and_present<NamedProperty *>(arg)) {
// TODO
continue;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/81899
More information about the Mlir-commits
mailing list