File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
llvm/utils/TableGen/Basic Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -436,12 +436,10 @@ void RuntimeLibcallEmitter::emitSystemRuntimeLibrarySetCalls(
436
436
SmallVector<PredicateWithCC, 0 > SortedPredicates =
437
437
PredicateSorter.takeVector ();
438
438
439
- sort (SortedPredicates, [](PredicateWithCC A, PredicateWithCC B) {
440
- if (!A.Predicate )
441
- return true ;
442
- if (!B.Predicate )
443
- return false ;
444
- return A.Predicate ->getName () < B.Predicate ->getName ();
439
+ llvm::sort (SortedPredicates, [](PredicateWithCC A, PredicateWithCC B) {
440
+ StringRef AName = A.Predicate ? A.Predicate ->getName () : " " ;
441
+ StringRef BName = B.Predicate ? B.Predicate ->getName () : " " ;
442
+ return AName < BName;
445
443
});
446
444
447
445
for (PredicateWithCC Entry : SortedPredicates) {
@@ -472,7 +470,8 @@ void RuntimeLibcallEmitter::emitSystemRuntimeLibrarySetCalls(
472
470
// This also makes it annoying to make use of the default set, since the
473
471
// entries from the default set may win over the replacements unless
474
472
// they are explicitly removed.
475
- sort (Funcs, [](const RuntimeLibcallImpl *A, const RuntimeLibcallImpl *B) {
473
+ stable_sort (Funcs, [](const RuntimeLibcallImpl *A,
474
+ const RuntimeLibcallImpl *B) {
476
475
return A->getProvides ()->getEnumVal () < B->getProvides ()->getEnumVal ();
477
476
});
478
477
You can’t perform that action at this time.
0 commit comments