summaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2018-04-06 20:18:05 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2018-04-06 20:18:05 +0000
commitdb6e78051dd0e15ab584bd494abc8b688a91c83a (patch)
tree54680040d12ecb6c9d5304ed17c2c63ac3d0d63e /llvm/lib/TableGen
parente7303c877c41af30cd2c32cc5aa5cd5617e2ef2f (diff)
[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
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp8
1 files changed, 4 insertions, 4 deletions
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<Record *> UnsortedClasses) {
SmallVector<Record *, 4> 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);