[llvm] e47d6da - D'oh. Fix assert after a84922916e6eddf701b39fbd7fe0222cb0fee1d6.

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 19:23:08 PST 2019


Author: James Y Knight
Date: 2019-11-20T22:22:51-05:00
New Revision: e47d6da8a5dd6b9552f7b94e8b35453b4f09ffe4

URL: https://github.com/llvm/llvm-project/commit/e47d6da8a5dd6b9552f7b94e8b35453b4f09ffe4
DIFF: https://github.com/llvm/llvm-project/commit/e47d6da8a5dd6b9552f7b94e8b35453b4f09ffe4.diff

LOG: D'oh. Fix assert after a84922916e6eddf701b39fbd7fe0222cb0fee1d6.
(Which was attempting to fix unused variable warning in NDEBUG mode after 8ba56f322abf848cec78ff7f814f3ad84cd778be)

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp b/llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp
index 0643480a7099..5ffae128f5f0 100644
--- a/llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp
+++ b/llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp
@@ -57,9 +57,10 @@ struct MakeGuardsExplicitLegacyPass : public FunctionPass {
 
 static void turnToExplicitForm(CallInst *Guard, Function *DeoptIntrinsic) {
   // Replace the guard with an explicit branch (just like in GuardWidening).
+  BasicBlock *OriginalBB = Guard->getParent();
+  (void)OriginalBB;
   makeGuardControlFlowExplicit(DeoptIntrinsic, Guard, true);
-  assert(isWidenableBranch(Guard->getParent()->getTerminator()) &&
-         "should hold");
+  assert(isWidenableBranch(OriginalBB->getTerminator()) && "should hold");
 
   Guard->eraseFromParent();
 }


        


More information about the llvm-commits mailing list