ProfileSummary.cpp - use auto const& iterator in for-range loop to avoid copies....
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 21 Sep 2020 15:28:10 +0000 (16:28 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 21 Sep 2020 15:54:26 +0000 (16:54 +0100)
llvm/lib/IR/ProfileSummary.cpp

index ac6bcd9..453a278 100644 (file)
@@ -259,7 +259,7 @@ void ProfileSummary::printSummary(raw_ostream &OS) {
 
 void ProfileSummary::printDetailedSummary(raw_ostream &OS) {
   OS << "Detailed summary:\n";
-  for (auto Entry : DetailedSummary) {
+  for (const auto &Entry : DetailedSummary) {
     OS << Entry.NumCounts << " blocks with count >= " << Entry.MinCount
        << " account for "
        << format("%0.6g", (float)Entry.Cutoff / Scale * 100)