fix failures introduced in r85774
authorChris Lattner <sabre@nondot.org>
Mon, 2 Nov 2009 02:48:17 +0000 (02:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Nov 2009 02:48:17 +0000 (02:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85777 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp

index 7421d4f349ba70afbb741c91e20c093cd94d4e35..e931c379894e6376821f0de7186edbb9838b3089 100644 (file)
@@ -451,7 +451,8 @@ void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI,
     }
     
     // Constant condition variables mean the branch can only go a single way.
-    Succs[cast<ConstantInt>(BCValue.getConstant())->isZero()] = true;
+    if (BCValue.isConstant())
+      Succs[cast<ConstantInt>(BCValue.getConstant())->isZero()] = true;
     return;
   }