[llvm] dbed9d5 - VersionPrinter - use const auto& iterator in for-range-loop.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 03:01:27 PDT 2020
Author: Simon Pilgrim
Date: 2020-07-09T10:56:38+01:00
New Revision: dbed9d5ce7f5ab870b3ff20a14ee6c366c803fdb
URL: https://github.com/llvm/llvm-project/commit/dbed9d5ce7f5ab870b3ff20a14ee6c366c803fdb
DIFF: https://github.com/llvm/llvm-project/commit/dbed9d5ce7f5ab870b3ff20a14ee6c366c803fdb.diff
LOG: VersionPrinter - use const auto& iterator in for-range-loop.
Avoids unnecessary copies and silences clang tidy warning.
Added:
Modified:
llvm/lib/Support/CommandLine.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index cee96083f700..12ef0d511b14 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -2537,7 +2537,7 @@ class VersionPrinter {
// information.
if (ExtraVersionPrinters != nullptr) {
outs() << '\n';
- for (auto I : *ExtraVersionPrinters)
+ for (const auto &I : *ExtraVersionPrinters)
I(outs());
}
More information about the llvm-commits
mailing list