[llvm] r240819 - Wrap assert loops in #ifndef NDEBUG

Pete Cooper peter_cooper at apple.com
Fri Jun 26 12:23:20 PDT 2015


Author: pete
Date: Fri Jun 26 14:23:20 2015
New Revision: 240819

URL: http://llvm.org/viewvc/llvm-project?rev=240819&view=rev
Log:
Wrap assert loops in #ifndef NDEBUG

The body of the loops here only contained asserts.  This triggered an unused variable
warning on release builds and -Werror on the bots.

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=240819&r1=240818&r2=240819&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jun 26 14:23:20 2015
@@ -1165,6 +1165,7 @@ void SelectionDAGLegalize::LegalizeOp(SD
   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(SD
                               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;





More information about the llvm-commits mailing list