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(
436436 SmallVector<PredicateWithCC, 0 > SortedPredicates =
437437 PredicateSorter.takeVector ();
438438
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;
445443 });
446444
447445 for (PredicateWithCC Entry : SortedPredicates) {
@@ -472,7 +470,8 @@ void RuntimeLibcallEmitter::emitSystemRuntimeLibrarySetCalls(
472470 // This also makes it annoying to make use of the default set, since the
473471 // entries from the default set may win over the replacements unless
474472 // they are explicitly removed.
475- sort (Funcs, [](const RuntimeLibcallImpl *A, const RuntimeLibcallImpl *B) {
473+ stable_sort (Funcs, [](const RuntimeLibcallImpl *A,
474+ const RuntimeLibcallImpl *B) {
476475 return A->getProvides ()->getEnumVal () < B->getProvides ()->getEnumVal ();
477476 });
478477
You can’t perform that action at this time.
0 commit comments