From e335f259498a550c73d3f77d9765cbe610a60b4e Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 4 Oct 2015 04:53:55 +0000 Subject: SourceRanges are small and trivially copyable, don't them by reference. llvm-svn: 249259 --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index f70a7d04ae9..56d57c50140 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -2579,9 +2579,7 @@ void BugReport::Profile(llvm::FoldingSetNodeID& hash) const { hash.AddPointer(GetCurrentOrPreviousStmt(ErrorNode)); } - for (SmallVectorImpl::const_iterator I = - Ranges.begin(), E = Ranges.end(); I != E; ++I) { - const SourceRange range = *I; + for (SourceRange range : Ranges) { if (!range.isValid()) continue; hash.AddInteger(range.getBegin().getRawEncoding()); @@ -3431,7 +3429,7 @@ void BugReporter::FlushReport(BugReport *exampleReport, PathDiagnosticLocation L = exampleReport->getLocation(getSourceManager()); auto piece = llvm::make_unique( L, exampleReport->getDescription()); - for (const SourceRange &Range : exampleReport->getRanges()) + for (SourceRange Range : exampleReport->getRanges()) piece->addRange(Range); D->setEndOfPath(std::move(piece)); } -- cgit v1.2.3