Skip to content

Commit

Permalink
[AsmPrinter] DebugLocEntry::dump() - Use const-ref iterator in for-ra…
Browse files Browse the repository at this point in the history
…nge loop. NFCI.

Avoid unnecessary copies, reported by MSVC static analyzer.
  • Loading branch information
RKSimon committed Sep 17, 2021
1 parent e4b2f66 commit 9e70d4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9e70d4e

Please sign in to comment.