add more checking

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20296 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-02-24 05:25:17 +00:00
parent 83beacddc9
commit 69331f5726

View File

@ -1815,8 +1815,12 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result...
std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = $8->begin(),
E = $8->end();
for (; I != E; ++I)
S->addCase(I->first, I->second);
for (; I != E; ++I) {
if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
S->addCase(CI, I->second);
else
ThrowException("Switch case is constant, but not a simple integer!");
}
delete $8;
}
| SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' {