From 1b0e2f2a209e5ab91e71d51ed4fe13c7bf4f1821 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Grang Date: Fri, 6 Apr 2018 20:18:05 +0000 Subject: [TableGen] Change std::sort to llvm::sort in response to r327219 Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: stoklund, kparzysz, dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45144 llvm-svn: 329451 --- llvm/lib/TableGen/Record.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/TableGen') diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 30889b1e6e4..cc807d187ef 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -157,10 +157,10 @@ RecordRecTy *RecordRecTy::get(ArrayRef UnsortedClasses) { SmallVector Classes(UnsortedClasses.begin(), UnsortedClasses.end()); - std::sort(Classes.begin(), Classes.end(), - [](Record *LHS, Record *RHS) { - return LHS->getNameInitAsString() < RHS->getNameInitAsString(); - }); + llvm::sort(Classes.begin(), Classes.end(), + [](Record *LHS, Record *RHS) { + return LHS->getNameInitAsString() < RHS->getNameInitAsString(); + }); FoldingSetNodeID ID; ProfileRecordRecTy(ID, Classes); -- cgit v1.2.3