Wrap assert loops in #ifndef NDEBUG
authorPete Cooper <peter_cooper@apple.com>
Fri, 26 Jun 2015 19:23:20 +0000 (19:23 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 26 Jun 2015 19:23:20 +0000 (19:23 +0000)
The body of the loops here only contained asserts.  This triggered an unused variable
warning on release builds and -Werror on the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240819 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index e90d45eec609f00ed9361e6f0266e0a5e9360b10..c0d7871bf08b5445af1635b0969bd8bc508bee10 100644 (file)
@@ -1165,6 +1165,7 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
   if (Node->getOpcode() == ISD::TargetConstant) // Allow illegal target nodes.
     return;
 
+#ifndef NDEBUG
   for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
     assert(TLI.getTypeAction(*DAG.getContext(), Node->getValueType(i)) ==
              TargetLowering::TypeLegal &&
@@ -1175,6 +1176,7 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
                               Op.getValueType()) == TargetLowering::TypeLegal ||
                               Op.getOpcode() == ISD::TargetConstant) &&
                               "Unexpected illegal type!");
+#endif
 
   // Figure out the correct action; the way to query this varies by opcode
   TargetLowering::LegalizeAction Action = TargetLowering::Legal;