[llvm] 38124fe - [ProfileData] Use a range-based for loop (NFC) (#94856)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 8 08:36:45 PDT 2024
Author: Kazu Hirata
Date: 2024-06-08T08:36:42-07:00
New Revision: 38124fef7ec70cf73f3b86a03a287a88a16d7926
URL: https://github.com/llvm/llvm-project/commit/38124fef7ec70cf73f3b86a03a287a88a16d7926
DIFF: https://github.com/llvm/llvm-project/commit/38124fef7ec70cf73f3b86a03a287a88a16d7926.diff
LOG: [ProfileData] Use a range-based for loop (NFC) (#94856)
While I am at it, this patch adds const to a couple of places.
Added:
Modified:
llvm/lib/ProfileData/InstrProfReader.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 7758363d9c952..27855bf92b871 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -145,11 +145,11 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer,
static void
printBinaryIdsInternal(raw_ostream &OS,
- std::vector<llvm::object::BuildID> &BinaryIds) {
+ const std::vector<llvm::object::BuildID> &BinaryIds) {
OS << "Binary IDs: \n";
- for (auto BI : BinaryIds) {
- for (uint64_t I = 0; I < BI.size(); I++)
- OS << format("%02x", BI[I]);
+ for (const auto &BI : BinaryIds) {
+ for (auto I : BI)
+ OS << format("%02x", I);
OS << "\n";
}
}
More information about the llvm-commits
mailing list