diff options
author | Dale Johannesen <dalej@apple.com> | 2008-05-23 01:01:31 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-05-23 01:01:31 +0000 |
commit | fecb88249f4a68a556f084c2eb82ba4b6f55d027 (patch) | |
tree | 97289af19582146166274f38ccda26c3112b0748 /llvm/lib/Transforms/Scalar/SCCP.cpp | |
parent | e3fa7136b0da03be02583d8a4d5cf72e722234e0 (diff) | |
download | bcm5719-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/Scalar/SCCP.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 2 |
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 { |