Skip to content

Commit e5a5881

Browse files
authored
Fixes for parentheses warnings on gcc/clang. (#19957)
Tentative fix for #19956. Unfortunately the clang warning (https://clang.llvm.org/docs/DiagnosticsReference.html#wlogical-op-parentheses) does not flag the same code that gcc does. Might as well enable it just in case though.
1 parent 8db4e38 commit e5a5881

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build_tools/cmake/iree_copts.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ iree_select_compiler_opts(IREE_DEFAULT_COPTS
211211
"-Wimplicit-fallthrough"
212212
"-Winfinite-recursion"
213213
"-Wliteral-conversion"
214+
"-Wlogical-op-parentheses"
214215
"-Wnon-virtual-dtor"
215216
"-Woverloaded-virtual"
216217
"-Wpointer-arith"

compiler/src/iree/compiler/Codegen/Common/MaterializeEncodingIntoPadding.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ static RankedTensorType getPaddedType(RankedTensorType type) {
5959
ArrayRef<int32_t> padding = layout.getPadding().asArrayRef();
6060
auto newShape = llvm::to_vector_of<int64_t>(type.getShape());
6161
for (auto [newDim, padValue] : llvm::zip_equal(newShape, padding)) {
62-
assert(padValue == 0 || !ShapedType::isDynamic(newDim) &&
63-
"Padding dynamic dims not supported");
62+
assert((padValue == 0 || !ShapedType::isDynamic(newDim)) &&
63+
"Padding dynamic dims not supported");
6464
newDim += padValue;
6565
}
6666

0 commit comments

Comments
 (0)