aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commitfb06d0ca959cff2351601aa4f935be74c6b41f3c (patch)
treee3bf60d257da32968e967f4ab00acf60057ebb99 /lib
parent00b66efa0a75455aa7de327424a67058a059d379 (diff)
downloadexternal_llvm-fb06d0ca959cff2351601aa4f935be74c6b41f3c.zip
external_llvm-fb06d0ca959cff2351601aa4f935be74c6b41f3c.tar.gz
external_llvm-fb06d0ca959cff2351601aa4f935be74c6b41f3c.tar.bz2
Allow for switch with no cases. Was causing fault
in gcc.dg/pr27531-1.c. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 9c17b77..79cda33 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/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 {