[llvm] 9e70d4e - [AsmPrinter] DebugLocEntry::dump() - Use const-ref iterator in for-range loop. NFCI.
    Simon Pilgrim via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Sep 17 04:12:44 PDT 2021
    
    
  
Author: Simon Pilgrim
Date: 2021-09-17T12:11:54+01:00
New Revision: 9e70d4e5f2e447685ee99d6327bbe60f89962e92
URL: https://github.com/llvm/llvm-project/commit/9e70d4e5f2e447685ee99d6327bbe60f89962e92
DIFF: https://github.com/llvm/llvm-project/commit/9e70d4e5f2e447685ee99d6327bbe60f89962e92.diff
LOG: [AsmPrinter] DebugLocEntry::dump() - Use const-ref iterator in for-range loop. NFCI.
Avoid unnecessary copies, reported by MSVC static analyzer.
Added: 
    
Modified: 
    llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
Removed: 
    
################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
index 62ebadaf3cbe..d7ab2091967f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
@@ -158,7 +158,7 @@ class DbgValueLoc {
   friend bool operator<(const DbgValueLoc &, const DbgValueLoc &);
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
   LLVM_DUMP_METHOD void dump() const {
-    for (DbgValueLocEntry DV : ValueLocEntries)
+    for (const DbgValueLocEntry &DV : ValueLocEntries)
       DV.dump();
     if (Expression)
       Expression->dump();
        
    
    
More information about the llvm-commits
mailing list