[llvm] 3ae07b2 - TargetPassConfig.cpp - use auto const& iterator in for-range loop to avoid copies. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 09:21:14 PDT 2020


Author: Simon Pilgrim
Date: 2020-09-21T17:17:11+01:00
New Revision: 3ae07b2a33f5541b36913280564420aaa46a54f8

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

LOG: TargetPassConfig.cpp - use auto const& iterator in for-range loop to avoid copies. NFCI.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TargetPassConfig.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 19db8eb480ca..ef070ee7dbae 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -550,7 +550,7 @@ void TargetPassConfig::addPass(Pass *P, bool verifyAfter) {
       addMachinePostPasses(Banner, /*AllowVerify*/ verifyAfter);
 
     // Add the passes after the pass P if there is any.
-    for (auto IP : Impl->InsertedPasses) {
+    for (const auto &IP : Impl->InsertedPasses) {
       if (IP.TargetPassID == PassID)
         addPass(IP.getInsertedPass(), IP.VerifyAfter);
     }


        


More information about the llvm-commits mailing list