fix failures introduced in r85774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85777 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 7421d4f..e931c37 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -451,7 +451,8 @@
}
// 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;
}