Enable a few more clang-tidy checks with fixes (#9426)
We can enable a few more clang-tidy checks by correcting a few minor bugs.
diff --git a/compiler/src/.clang-tidy b/compiler/src/.clang-tidy
index 4e3f659..8c05c51 100644
--- a/compiler/src/.clang-tidy
+++ b/compiler/src/.clang-tidy
@@ -9,7 +9,5 @@
-misc-unused-using-decls,
-llvm-else-after-return,
-llvm-include-order,
- -llvm-qualified-auto,
- -misc-redundant-expression,
- -llvm-namespace-comment
+ -llvm-qualified-auto
diff --git a/compiler/src/iree/compiler/Codegen/Common/FoldTensorExtractOpPass.cpp b/compiler/src/iree/compiler/Codegen/Common/FoldTensorExtractOpPass.cpp
index 21cf61c..6b26cf6 100644
--- a/compiler/src/iree/compiler/Codegen/Common/FoldTensorExtractOpPass.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/FoldTensorExtractOpPass.cpp
@@ -18,7 +18,7 @@
namespace {
#include "iree/compiler/Codegen/Common/FoldTensorExtractOp.cpp.inc"
-}
+} // namespace
namespace {
/// Upstream canonicalization passes fold
diff --git a/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp b/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp
index 4eb9e46..47a5275 100644
--- a/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp
+++ b/compiler/src/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp
@@ -2048,7 +2048,7 @@
if (ordering == ORDERED) {
return result != APFloat::cmpEqual;
} else {
- return result != APFloat::cmpEqual || result == APFloat::cmpUnordered;
+ return result != APFloat::cmpEqual && result != APFloat::cmpUnordered;
}
});
}
diff --git a/runtime/src/.clang-tidy b/runtime/src/.clang-tidy
index 97faac2..0eaac09 100644
--- a/runtime/src/.clang-tidy
+++ b/runtime/src/.clang-tidy
@@ -1,7 +1 @@
-
-Checks: >
- -clang-analyzer-deadcode*,
- -clang-analyzer-cplusplus*,
- -clang-analyzer-core*
-
-HeaderFilterRegex: '.*^(third_party|googletest).*'
+Checks: -clang-analyzer-cplusplus*,-clang-analyzer-core*
diff --git a/runtime/src/iree/tooling/vm_util.cc b/runtime/src/iree/tooling/vm_util.cc
index 909f578..276259f 100644
--- a/runtime/src/iree/tooling/vm_util.cc
+++ b/runtime/src/iree/tooling/vm_util.cc
@@ -105,7 +105,7 @@
IREE_STATUS_RESOURCE_EXHAUSTED,
"a shape rank of %zu is just a little bit excessive, eh?", shape_rank);
}
- shape_result = iree_status_ignore(shape_result);
+ iree_status_ignore(shape_result);
iree_hal_dim_t* shape =
(iree_hal_dim_t*)iree_alloca(shape_rank * sizeof(iree_hal_dim_t));
IREE_RETURN_IF_ERROR(iree_hal_parse_shape_and_element_type(