[llvm] 986841c - SelectionDAGDumper.cpp - printrWithDepthHelper - remove dead code. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 11:23:24 PDT 2021


Author: Simon Pilgrim
Date: 2021-07-30T19:23:04+01:00
New Revision: 986841cca24139a20ebbcd8f8c8684aeb1812641

URL: https://github.com/llvm/llvm-project/commit/986841cca24139a20ebbcd8f8c8684aeb1812641
DIFF: https://github.com/llvm/llvm-project/commit/986841cca24139a20ebbcd8f8c8684aeb1812641.diff

LOG: SelectionDAGDumper.cpp - printrWithDepthHelper - remove dead code. NFCI.

Fixes coverity warning - we have an early-out for unsigned depth == 0, so the depth < 1 early-out later on is dead code.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
index 40083c614a6c7..757f949716d86 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
@@ -1012,15 +1012,12 @@ static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N,
 
   N->print(OS, G);
 
-  if (depth < 1)
-    return;
-
   for (const SDValue &Op : N->op_values()) {
     // Don't follow chain operands.
     if (Op.getValueType() == MVT::Other)
       continue;
     OS << '\n';
-    printrWithDepthHelper(OS, Op.getNode(), G, depth-1, indent+2);
+    printrWithDepthHelper(OS, Op.getNode(), G, depth - 1, indent + 2);
   }
 }
 


        


More information about the llvm-commits mailing list