[llvm] 9d4575c - [llvm] Make lambda take const reference to prevent unneeded copy (NFC)

Youngsuk Kim via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 13:35:09 PDT 2024


Author: Youngsuk Kim
Date: 2024-05-02T15:34:03-05:00
New Revision: 9d4575c910c210c3780b1c882e09732464dd4f44

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

LOG: [llvm] Make lambda take const reference to prevent unneeded copy (NFC)

Closes #89198

Added: 
    

Modified: 
    llvm/lib/CodeGen/RDFGraph.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RDFGraph.cpp b/llvm/lib/CodeGen/RDFGraph.cpp
index 6276a4722e3f0d..ff0fd61078c0b6 100644
--- a/llvm/lib/CodeGen/RDFGraph.cpp
+++ b/llvm/lib/CodeGen/RDFGraph.cpp
@@ -264,7 +264,7 @@ raw_ostream &operator<<(raw_ostream &OS, const Print<Block> &P) {
   MachineBasicBlock *BB = P.Obj.Addr->getCode();
   unsigned NP = BB->pred_size();
   std::vector<int> Ns;
-  auto PrintBBs = [&OS](std::vector<int> Ns) -> void {
+  auto PrintBBs = [&OS](const std::vector<int> &Ns) -> void {
     unsigned N = Ns.size();
     for (int I : Ns) {
       OS << "%bb." << I;


        


More information about the llvm-commits mailing list