diff options
author | Tobias Grosser <tobias@grosser.es> | 2014-09-10 14:42:06 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2014-09-10 14:42:06 +0000 |
commit | 0244ee872efbd126d6e89dd8eb0d4c1b28a836bd (patch) | |
tree | f8bb046a380b571f0379680935d328f9064b0fa7 /polly/lib/CodeGen/CodeGeneration.cpp | |
parent | 31f3da3d2afdff29de2e9f2d065f379162932354 (diff) | |
download | bcm5719-llvm-0244ee872efbd126d6e89dd8eb0d4c1b28a836bd.tar.gz bcm5719-llvm-0244ee872efbd126d6e89dd8eb0d4c1b28a836bd.zip |
Use "const auto &" in range based for loops
This previous code added in r216842 most likely created unnecessary copies.
Reported-by: Duncan P. N. Exon Smith <dexonsmith@apple.com>
llvm-svn: 217507
Diffstat (limited to 'polly/lib/CodeGen/CodeGeneration.cpp')
-rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index f215e5774ed..c9f7c3f2334 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -488,7 +488,7 @@ void ClastStmtCodeGen::codegen(const clast_user_stmt *u, // Copy the current value map into all vector maps if the key wasn't // available yet. This is needed in case vector codegen is performed in // OpenMP subfunctions. - for (auto KV : ValueMap) + for (const auto &KV : ValueMap) for (int i = 0; i < VectorDimensions; ++i) VectorMap[i].insert(KV); @@ -561,7 +561,7 @@ SetVector<Value *> ClastStmtCodeGen::getOMPValues(const clast_stmt *Body) { SetVector<Value *> Values; // The clast variables - for (auto I : ClastVars) + for (const auto &I : ClastVars) Values.insert(I.second); // Find the temporaries that are referenced in the clast statements' @@ -583,12 +583,12 @@ void ClastStmtCodeGen::updateWithValueMap(OMPGenerator::ValueToValueMapTy &VMap) { std::set<Value *> Inserted; - for (auto I : ClastVars) { + for (const auto &I : ClastVars) { ClastVars[I.first] = VMap[I.second]; Inserted.insert(I.second); } - for (auto I : VMap) { + for (const auto &I : VMap) { if (Inserted.count(I.first)) continue; @@ -1060,7 +1060,7 @@ public: } virtual void printScop(raw_ostream &OS) const { - for (auto PI : ParallelLoops) + for (const auto &PI : ParallelLoops) OS << "Parallel loop with iterator '" << PI << "' generated\n"; } |