[llvm] r265092 - Protect some assertions with NDEBUG rather than DEBUG().

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 18:09:12 PDT 2016


Author: jlebar
Date: Thu Mar 31 20:09:12 2016
New Revision: 265092

URL: http://llvm.org/viewvc/llvm-project?rev=265092&view=rev
Log:
Protect some assertions with NDEBUG rather than DEBUG().

DEBUG() only runs if you pass -debug, but these assertions are generally
useful.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=265092&r1=265091&r2=265092&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Mar 31 20:09:12 2016
@@ -7446,12 +7446,13 @@ TargetLowering::LowerCallTo(TargetLoweri
     return std::make_pair(SDValue(), SDValue());
   }
 
-  DEBUG(for (unsigned i = 0, e = CLI.Ins.size(); i != e; ++i) {
-          assert(InVals[i].getNode() &&
-                 "LowerCall emitted a null value!");
-          assert(EVT(CLI.Ins[i].VT) == InVals[i].getValueType() &&
-                 "LowerCall emitted a value with the wrong type!");
-        });
+#ifndef NDEBUG
+  for (unsigned i = 0, e = CLI.Ins.size(); i != e; ++i) {
+    assert(InVals[i].getNode() && "LowerCall emitted a null value!");
+    assert(EVT(CLI.Ins[i].VT) == InVals[i].getValueType() &&
+           "LowerCall emitted a value with the wrong type!");
+  }
+#endif
 
   SmallVector<SDValue, 4> ReturnValues;
   if (!CanLowerReturn) {




More information about the llvm-commits mailing list