Skip to content

Commit

Permalink
[mlir] Fix -Wunused-but-set-variable in ModuleTranslation.cpp (NFC)
Browse files Browse the repository at this point in the history
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1050:11:
error: variable 'numConstantsHit' set but not used [-Werror,-Wunused-but-set-variable]
      int numConstantsHit = 0;
          ^
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1051:11:
error: variable 'numConstantsErased' set but not used [-Werror,-Wunused-but-set-variable]
      int numConstantsErased = 0;
          ^
2 errors generated.
  • Loading branch information
DamonFool committed Feb 27, 2024
1 parent 2e56484 commit ef7417f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ LogicalResult ModuleTranslation::convertGlobals() {
if (Block *initializer = op.getInitializerBlock()) {
llvm::IRBuilder<> builder(llvmModule->getContext());

int numConstantsHit = 0;
int numConstantsErased = 0;
[[maybe_unused]] int numConstantsHit = 0;
[[maybe_unused]] int numConstantsErased = 0;
DenseMap<llvm::ConstantAggregate *, int> constantAggregateUseMap;

for (auto &op : initializer->without_terminator()) {
Expand Down

0 comments on commit ef7417f

Please sign in to comment.