[Mlir-commits] [mlir] 1a2a34a - Add NDEBUG checks around debug only loop to avoid unused variable

Eric Christopher llvmlistbot at llvm.org
Mon Aug 24 17:59:09 PDT 2020


Author: Eric Christopher
Date: 2020-08-24T17:58:57-07:00
New Revision: 1a2a34a38a7d6310b38958fbe49c274431ac223d

URL: https://github.com/llvm/llvm-project/commit/1a2a34a38a7d6310b38958fbe49c274431ac223d
DIFF: https://github.com/llvm/llvm-project/commit/1a2a34a38a7d6310b38958fbe49c274431ac223d.diff

LOG: Add NDEBUG checks around debug only loop to avoid unused variable
warnings.

Added: 
    

Modified: 
    mlir/tools/mlir-reduce/ReductionTreeUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-reduce/ReductionTreeUtils.cpp b/mlir/tools/mlir-reduce/ReductionTreeUtils.cpp
index 5fdb1341f89c..13d35a258aff 100644
--- a/mlir/tools/mlir-reduce/ReductionTreeUtils.cpp
+++ b/mlir/tools/mlir-reduce/ReductionTreeUtils.cpp
@@ -32,8 +32,10 @@ void ReductionTreeUtils::updateSmallestNode(ReductionNode *currNode,
                                             ReductionNode *&smallestNode,
                                             std::vector<int> path) {
   LLVM_DEBUG(llvm::dbgs() << "\nTree Path: root");
+  #ifndef NDEBUG
   for (int nodeIndex : path)
     LLVM_DEBUG(llvm::dbgs() << " -> " << nodeIndex);
+  #endif
 
   LLVM_DEBUG(llvm::dbgs() << "\nSize (chars): " << currNode->getSize());
   if (currNode->getSize() < smallestNode->getSize()) {


        


More information about the Mlir-commits mailing list