Skip to content

Commit

Permalink
Enable -Wunused-variable warning. (iree-org#2513)
Browse files Browse the repository at this point in the history
We've been passing with this enabled before, but were not enforcing it in open source builds.
  • Loading branch information
ScottTodd authored Jul 14, 2020
1 parent f4f2fec commit b093bdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ build:generic_clang --copt=-Wno-unused-function
# Enable warnings we do care about.
build:generic_clang --copt=-Wimplicit-fallthrough
build:generic_clang --copt=-Wthread-safety-analysis
build:generic_clang --copt=-Wunused-variable

# C++14 standard version is required.
build:generic_clang --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
Expand Down
1 change: 1 addition & 0 deletions build_tools/cmake/iree_copts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ iree_select_compiler_opts(IREE_DEFAULT_COPTS
# Enable some warnings
"-Wimplicit-fallthrough"
"-Wthread-safety-analysis"
"-Wunused-variable"
CLANG_OR_GCC
"-Wno-unused-parameter"
"-Wno-undef"
Expand Down
5 changes: 2 additions & 3 deletions iree/compiler/Dialect/HAL/Transforms/PublicAbiGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ LogicalResult generateSynchronousBody(

LogicalResult generateAsynchronousBody(FuncOp funcOp, FuncOp syncFuncOp,
OpBuilder moduleBuilder) {
auto *ctx = funcOp.getContext();
auto loc = funcOp.getLoc();
Block *entryBlock = funcOp.addEntryBlock();
OpBuilder builder = OpBuilder::atBlockEnd(entryBlock);
Expand All @@ -228,8 +227,8 @@ LogicalResult generateAsynchronousBody(FuncOp funcOp, FuncOp syncFuncOp,
auto waitValue = entryBlock->getArgument(1);
auto waitOp = builder.create<HAL::SemaphoreAwaitOp>(
loc, builder.getIntegerType(32), waitSemaphore, waitValue);
auto checkSuccessOp = builder.create<HAL::CheckSuccessOp>(
loc, waitOp.getResult(), "semaphore wait failed");
builder.create<HAL::CheckSuccessOp>(loc, waitOp.getResult(),
"semaphore wait failed");

// Trim the first (wait semaphore/value) and last (signal semaphore/value)
// two arguments.
Expand Down

0 comments on commit b093bdd

Please sign in to comment.