From 5606ca9edd5a014f4e134d0c4d4f20aff4be9a28 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 22 Feb 2015 20:58:38 +0000 Subject: [PATCH] Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230181 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 4c638c8e5af..ca9ab54b5aa 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -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(*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(*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 -- 2.34.1