Changed the fundemental architecture of Operands for Instructions.  Now
Operands are maintained as a vector<Use> in the User class, and operator
iterators are provided as before.  Getting an operand no longer requires
a virtual function call.

WARNING: getOperand(x) where x >= getNumOperands() will now assert instead
of returning null!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 8b59e19..5bb75c7 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -408,10 +408,10 @@
 	markExecutable(Succ);
     } else if (SCValue.isConstant()) {
       ConstPoolVal *CPV = SCValue.getConstant();
-      for (SwitchInst::dest_iterator I = SI->dest_begin(), E = SI->dest_end();
-	   I != E; ++I) {
-	if (I->first->equals(CPV)) {   // Found the right branch...
-	  markExecutable(I->second);
+      // Make sure to skip the "default value" which isn't a value
+      for (unsigned i = 1, E = SI->getNumSuccessors(); i != E; ++i) {
+	if (SI->getSuccessorValue(i)->equals(CPV)) {// Found the right branch...
+	  markExecutable(SI->getSuccessor(i));
 	  return;
 	}
       }