summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-05-23 01:01:31 +0000
committerDale Johannesen <dalej@apple.com>2008-05-23 01:01:31 +0000
commitfecb88249f4a68a556f084c2eb82ba4b6f55d027 (patch)
tree97289af19582146166274f38ccda26c3112b0748 /llvm/lib/Transforms
parente3fa7136b0da03be02583d8a4d5cf72e722234e0 (diff)
downloadbcm5719-llvm-fecb88249f4a68a556f084c2eb82ba4b6f55d027.tar.gz
bcm5719-llvm-fecb88249f4a68a556f084c2eb82ba4b6f55d027.zip
Allow for switch with no cases. Was causing fault
in gcc.dg/pr27531-1.c. llvm-svn: 51464
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 9c17b77954e..79cda33f793 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -1379,6 +1379,8 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) {
if (!getValueState(BI->getCondition()).isUndefined())
continue;
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
+ if (SI->getNumSuccessors()<2) // no cases
+ continue;
if (!getValueState(SI->getCondition()).isUndefined())
continue;
} else {
OpenPOWER on IntegriCloud