[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Chris Lattner
lattner at cs.uiuc.edu
Wed Feb 23 21:25:30 PST 2005
Changes in directory llvm/lib/AsmParser:
llvmAsmParser.y updated: 1.213 -> 1.214
---
Log message:
add more checking
---
Diffs of the changes: (+6 -2)
llvmAsmParser.y | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.213 llvm/lib/AsmParser/llvmAsmParser.y:1.214
--- llvm/lib/AsmParser/llvmAsmParser.y:1.213 Wed Feb 23 22:59:49 2005
+++ llvm/lib/AsmParser/llvmAsmParser.y Wed Feb 23 23:25:17 2005
@@ -1815,8 +1815,12 @@
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 '[' ']' {
More information about the llvm-commits
mailing list