diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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<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 |