Protect some assertions with NDEBUG rather than DEBUG().
authorJustin Lebar <jlebar@google.com>
Fri, 1 Apr 2016 01:09:12 +0000 (01:09 +0000)
committerJustin Lebar <jlebar@google.com>
Fri, 1 Apr 2016 01:09:12 +0000 (01:09 +0000)
DEBUG() only runs if you pass -debug, but these assertions are generally
useful.

llvm-svn: 265092

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 71c015d..e3acfd2 100644 (file)
@@ -7446,12 +7446,13 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
     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) {