[llvm] 5e5e51e - Make use of std::inserter. NFC.

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 06:43:53 PST 2024


Author: Jay Foad
Date: 2024-02-13T14:34:58Z
New Revision: 5e5e51e9062895bed9fcf0dbb157d868be0adf8d

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

LOG: Make use of std::inserter. NFC.

Added: 
    

Modified: 
    llvm/lib/Support/DeltaAlgorithm.cpp
    llvm/utils/TableGen/AsmMatcherEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/DeltaAlgorithm.cpp b/llvm/lib/Support/DeltaAlgorithm.cpp
index 341de244547cf4..d763cded6e7ea3 100644
--- a/llvm/lib/Support/DeltaAlgorithm.cpp
+++ b/llvm/lib/Support/DeltaAlgorithm.cpp
@@ -83,9 +83,9 @@ bool DeltaAlgorithm::Search(const changeset_ty &Changes,
     if (Sets.size() > 2) {
       // FIXME: This is really slow.
       changeset_ty Complement;
-      std::set_
diff erence(
-        Changes.begin(), Changes.end(), it->begin(), it->end(),
-        std::insert_iterator<changeset_ty>(Complement, Complement.begin()));
+      std::set_
diff erence(Changes.begin(), Changes.end(), it->begin(),
+                          it->end(),
+                          std::inserter(Complement, Complement.begin()));
       if (GetTestResult(Complement)) {
         changesetlist_ty ComplementSets;
         ComplementSets.insert(ComplementSets.end(), Sets.begin(), it);

diff  --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index d6dc4b7881b830..2c2c39a3ef54ff 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1269,9 +1269,9 @@ void AsmMatcherInfo::buildRegisterClasses(
       }
 
       RegisterSet Tmp;
-      std::insert_iterator<RegisterSet> II(Tmp, Tmp.begin());
       std::set_intersection(ContainingSet.begin(), ContainingSet.end(),
-                            RS.begin(), RS.end(), II, LessRecordByID());
+                            RS.begin(), RS.end(),
+                            std::inserter(Tmp, Tmp.begin()), LessRecordByID());
       ContainingSet = std::move(Tmp);
     }
 


        


More information about the llvm-commits mailing list