From 1a8ff89653d2a80a013701fe927d2d32491bff59 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Tue, 17 Dec 2019 21:57:58 +0100 Subject: [IR] Use a reference in a range-based for This avoids unneeded copies when using a range-based for loops. This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D70870 --- llvm/lib/IR/ModuleSummaryIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp') diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp index a3bc14c..5d35dbe 100644 --- a/llvm/lib/IR/ModuleSummaryIndex.cpp +++ b/llvm/lib/IR/ModuleSummaryIndex.cpp @@ -244,7 +244,7 @@ void ModuleSummaryIndex::dumpSCCs(raw_ostream &O) { !I.isAtEnd(); ++I) { O << "SCC (" << utostr(I->size()) << " node" << (I->size() == 1 ? "" : "s") << ") {\n"; - for (const ValueInfo V : *I) { + for (const ValueInfo &V : *I) { FunctionSummary *F = nullptr; if (V.getSummaryList().size()) F = cast(V.getSummaryList().front().get()); -- cgit v1.1