[llvm-commits] [llvm] r51464 - /llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Dale Johannesen dalej at apple.com
Thu May 22 18:01:32 PDT 2008


Author: johannes
Date: Thu May 22 20:01:31 2008
New Revision: 51464

URL: http://llvm.org/viewvc/llvm-project?rev=51464&view=rev
Log:
Allow for switch with no cases.  Was causing fault
in gcc.dg/pr27531-1.c.


Modified:
    llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=51464&r1=51463&r2=51464&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu May 22 20:01:31 2008
@@ -1379,6 +1379,8 @@
       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 {





More information about the llvm-commits mailing list