[clang] dc8a5f9 - [RISCV] Use llvm::stable_sort instead of std::stable_sort. NFC

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 19 11:40:31 PDT 2021


Author: Craig Topper
Date: 2021-10-19T11:37:40-07:00
New Revision: dc8a5f9419f5cc35fc3c9e8698ba3ebb6a3f974f

URL: https://github.com/llvm/llvm-project/commit/dc8a5f9419f5cc35fc3c9e8698ba3ebb6a3f974f
DIFF: https://github.com/llvm/llvm-project/commit/dc8a5f9419f5cc35fc3c9e8698ba3ebb6a3f974f.diff

LOG: [RISCV] Use llvm::stable_sort instead of std::stable_sort. NFC

Added: 
    

Modified: 
    clang/utils/TableGen/RISCVVEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp
index 2815673aa4e16..6c6ae0ebbdc96 100644
--- a/clang/utils/TableGen/RISCVVEmitter.cpp
+++ b/clang/utils/TableGen/RISCVVEmitter.cpp
@@ -975,11 +975,10 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
   OS << "#endif\n\n";
 
   // The same extension include in the same arch guard marco.
-  std::stable_sort(Defs.begin(), Defs.end(),
-                   [](const std::unique_ptr<RVVIntrinsic> &A,
-                      const std::unique_ptr<RVVIntrinsic> &B) {
-                     return A->getRISCVExtensions() < B->getRISCVExtensions();
-                   });
+  llvm::stable_sort(Defs, [](const std::unique_ptr<RVVIntrinsic> &A,
+                             const std::unique_ptr<RVVIntrinsic> &B) {
+    return A->getRISCVExtensions() < B->getRISCVExtensions();
+  });
 
   // Print intrinsic functions with macro
   emitArchMacroAndBody(Defs, OS, [](raw_ostream &OS, const RVVIntrinsic &Inst) {
@@ -1024,11 +1023,10 @@ void RVVEmitter::createCodeGen(raw_ostream &OS) {
   std::vector<std::unique_ptr<RVVIntrinsic>> Defs;
   createRVVIntrinsics(Defs);
   // IR name could be empty, use the stable sort preserves the relative order.
-  std::stable_sort(Defs.begin(), Defs.end(),
-                   [](const std::unique_ptr<RVVIntrinsic> &A,
-                      const std::unique_ptr<RVVIntrinsic> &B) {
-                     return A->getIRName() < B->getIRName();
-                   });
+  llvm::stable_sort(Defs, [](const std::unique_ptr<RVVIntrinsic> &A,
+                             const std::unique_ptr<RVVIntrinsic> &B) {
+    return A->getIRName() < B->getIRName();
+  });
   // Print switch body when the ir name or ManualCodegen changes from previous
   // iteration.
   RVVIntrinsic *PrevDef = Defs.begin()->get();


        


More information about the cfe-commits mailing list