Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevit...
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 22 Feb 2015 20:58:38 +0000 (20:58 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 22 Feb 2015 20:58:38 +0000 (20:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

index 4c638c8e5af1f1e243467068510fe79e27504245..ca9ab54b5aa8c84bc50a462d8131b427af3e8676 100644 (file)
@@ -1300,14 +1300,13 @@ makeStatepointExplicitImpl(const CallSite &CS, /* to replace */
   token->takeName(CS.getInstruction());
 
   // The GCResult is already inserted, we just need to find it
-  /* scope */ {
-    Instruction *toReplace = CS.getInstruction();
-    assert((toReplace->hasNUses(0) || toReplace->hasNUses(1)) &&
-           "only valid use before rewrite is gc.result");
-    if (toReplace->hasOneUse()) {
-      assert(isGCResult(cast<Instruction>(*toReplace->user_begin())));
-    }
-  }
+#ifndef NDEBUG
+  Instruction *toReplace = CS.getInstruction();
+  assert((toReplace->hasNUses(0) || toReplace->hasNUses(1)) &&
+         "only valid use before rewrite is gc.result");
+  assert(!toReplace->hasOneUse() ||
+         isGCResult(cast<Instruction>(*toReplace->user_begin())));
+#endif
 
   // Update the gc.result of the original statepoint (if any) to use the newly
   // inserted statepoint.  This is safe to do here since the token can't be