From 5e5d7840fbf292753232cef33b92c94fbee1d2e9 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 22 Feb 2015 20:58:38 +0000 Subject: Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build. llvm-svn: 230181 --- llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp') diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 4c638c8e5af..ca9ab54b5aa 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/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 -- cgit v1.2.3