Fix switch lowering to order cases in zext order, which is how we emit the

comparisons.  This fixes an infinite loop on CodeGen/Generic/switch-lower.ll
and PR1197

llvm-svn: 34216
This commit is contained in:
Chris Lattner 2007-02-13 01:05:56 +00:00
parent 72df49f506
commit 9056bae3be
1 changed files with 2 additions and 2 deletions

View File

@ -389,8 +389,8 @@ class SelectionDAGLowering {
struct CaseCmp {
bool operator () (const Case& C1, const Case& C2) {
assert(isa<ConstantInt>(C1.first) && isa<ConstantInt>(C2.first));
return cast<const ConstantInt>(C1.first)->getSExtValue() <
cast<const ConstantInt>(C2.first)->getSExtValue();
return cast<const ConstantInt>(C1.first)->getZExtValue() <
cast<const ConstantInt>(C2.first)->getZExtValue();
}
};