summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-10-04 04:53:55 +0000
committerCraig Topper <craig.topper@gmail.com>2015-10-04 04:53:55 +0000
commite335f259498a550c73d3f77d9765cbe610a60b4e (patch)
treeeabe6a8a456bf232adfde5932d669f4d69e7b1ca /clang/lib/StaticAnalyzer/Core/BugReporter.cpp
parent8f70a9f892db8f18277b0f5127d9063de237debc (diff)
downloadbcm5719-llvm-e335f259498a550c73d3f77d9765cbe610a60b4e.tar.gz
bcm5719-llvm-e335f259498a550c73d3f77d9765cbe610a60b4e.zip
SourceRanges are small and trivially copyable, don't them by reference.
llvm-svn: 249259
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp6
1 files changed, 2 insertions, 4 deletions
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<SourceRange>::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<PathDiagnosticEventPiece>(
L, exampleReport->getDescription());
- for (const SourceRange &Range : exampleReport->getRanges())
+ for (SourceRange Range : exampleReport->getRanges())
piece->addRange(Range);
D->setEndOfPath(std::move(piece));
}
OpenPOWER on IntegriCloud