diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-12-13 18:20:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-12-13 18:20:38 +0000 |
commit | 1e155ab7e1d9611502256a128bdd57a2546efef5 (patch) | |
tree | 831ac6842726a74bd1cd5f66b505f61dc85c9fa1 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | c30abdfa7d85656412f6abdad4fe6315f5f47831 (diff) | |
download | bcm5719-llvm-1e155ab7e1d9611502256a128bdd57a2546efef5.tar.gz bcm5719-llvm-1e155ab7e1d9611502256a128bdd57a2546efef5.zip |
Fix sort predicate. qsort(3)'s predicate semantics differ from std::sort's. Fixes PR 8780.
llvm-svn: 121705
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 71d9ef84832..9ca1079ab31 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -598,7 +598,7 @@ 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()); + return LHS->getValue().ult(RHS->getValue()) ? 1 : -1; } /// FoldValueComparisonIntoPredecessors - The specified terminator is a value |