mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
make qsort predicate more conformant by returning 0 for equal values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9c6b60eb28
commit
ba3c815570
@ -592,7 +592,11 @@ namespace {
|
||||
static int ConstantIntSortPredicate(const void *P1, const void *P2) {
|
||||
const ConstantInt *LHS = *(const ConstantInt**)P1;
|
||||
const ConstantInt *RHS = *(const ConstantInt**)P2;
|
||||
return LHS->getValue().ult(RHS->getValue()) ? 1 : -1;
|
||||
if (LHS->getValue().ult(RHS->getValue()))
|
||||
return 1;
|
||||
if (LHS->getValue() == RHS->getValue())
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// FoldValueComparisonIntoPredecessors - The specified terminator is a value
|
||||
|
Loading…
x
Reference in New Issue
Block a user