summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-10-04 04:53:37 +0000
committerCraig Topper <craig.topper@gmail.com>2015-10-04 04:53:37 +0000
commit8f70a9f892db8f18277b0f5127d9063de237debc (patch)
tree6fcd5e4868525e287c7480e788c0628da1bd8524
parent161935520d5a9cd1fcaddee39bb8438bcfec5552 (diff)
downloadbcm5719-llvm-8f70a9f892db8f18277b0f5127d9063de237debc.tar.gz
bcm5719-llvm-8f70a9f892db8f18277b0f5127d9063de237debc.zip
SourceRanges are small and trivially copyable, don't them by reference. NFC
llvm-svn: 249258
-rw-r--r--clang-tools-extra/clang-modernize/LoopConvert/LoopActions.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-modernize/LoopConvert/LoopActions.cpp b/clang-tools-extra/clang-modernize/LoopConvert/LoopActions.cpp
index 97c363d0468..e1420a37328 100644
--- a/clang-tools-extra/clang-modernize/LoopConvert/LoopActions.cpp
+++ b/clang-tools-extra/clang-modernize/LoopConvert/LoopActions.cpp
@@ -811,7 +811,7 @@ void LoopFixer::doConversion(ASTContext *Context,
AliasVarIsRef = AliasVar->getType()->isReferenceType();
// We keep along the entire DeclStmt to keep the correct range here.
- const SourceRange &ReplaceRange = AliasDecl->getSourceRange();
+ SourceRange ReplaceRange = AliasDecl->getSourceRange();
std::string ReplacementText;
if (AliasUseRequired)
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
index d8c2602be88..2432f072dac 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
@@ -243,11 +243,11 @@ std::vector<FixItHint> IncludeSorter::GetEdits() {
std::string CurrentText;
std::vector<FixItHint> Fixes;
for (const auto &LineEdit : Edits) {
- const SourceRange &EditRange = LineEdit.second.first;
// If the current edit is on the next line after the previous edit, add it
// to the current block edit.
if (LineEdit.first == CurrentEndLine + 1 &&
CurrentRange.getBegin() != CurrentRange.getEnd()) {
+ SourceRange EditRange = LineEdit.second.first;
if (EditRange.getBegin() != EditRange.getEnd()) {
++CurrentEndLine;
CurrentRange.setEnd(EditRange.getEnd());
@@ -260,7 +260,7 @@ std::vector<FixItHint> IncludeSorter::GetEdits() {
}
CurrentEndLine = LineEdit.first;
- CurrentRange = EditRange;
+ CurrentRange = LineEdit.second.first;
CurrentText = LineEdit.second.second;
}
}
OpenPOWER on IntegriCloud