Avoid some copies by using const references.

clang-tidy's performance-unnecessary-copy-initialization with some manual
fixes. No functional changes intended.

llvm-svn: 270988
This commit is contained in:
Benjamin Kramer
2016-05-27 12:30:51 +00:00
parent c91e38c5eb
commit 4fed928f53
13 changed files with 22 additions and 25 deletions

View File

@@ -77,15 +77,15 @@ static SetVector<BasicBlock *> buildExtractionBlockSet(IteratorT BBBegin,
// Loop over the blocks, adding them to our set-vector, and aborting with an
// empty set if we encounter invalid blocks.
for (IteratorT I = BBBegin, E = BBEnd; I != E; ++I) {
if (!Result.insert(*I))
do {
if (!Result.insert(*BBBegin))
llvm_unreachable("Repeated basic blocks in extraction input");
if (!isBlockValidForExtraction(**I)) {
if (!isBlockValidForExtraction(**BBBegin)) {
Result.clear();
return Result;
}
}
} while (++BBBegin != BBEnd);
#ifndef NDEBUG
for (SetVector<BasicBlock *>::iterator I = std::next(Result.begin()),