From: Simon Pilgrim Date: Tue, 21 Sep 2021 09:14:02 +0000 (+0100) Subject: RewriteStatepointsForGC - Use const-ref iterator in for-range loops. NFCI. X-Git-Tag: upstream/15.0.7~30990 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5d23d36de87f0cef3117df657d4f1d9133749c0;p=platform%2Fupstream%2Fllvm.git RewriteStatepointsForGC - Use const-ref iterator in for-range loops. NFCI. Avoid unnecessary copies, reported by MSVC static analyzer. --- diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 095c70f..415269d 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -910,7 +910,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &Cache) { #ifndef NDEBUG VerifyStates(); LLVM_DEBUG(dbgs() << "States after initialization:\n"); - for (auto Pair : States) { + for (const auto &Pair : States) { LLVM_DEBUG(dbgs() << " " << Pair.second << " for " << *Pair.first << "\n"); } #endif @@ -1002,7 +1002,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &Cache) { #ifndef NDEBUG VerifyStates(); LLVM_DEBUG(dbgs() << "States after meet iteration:\n"); - for (auto Pair : States) { + for (const auto &Pair : States) { LLVM_DEBUG(dbgs() << " " << Pair.second << " for " << *Pair.first << "\n"); } #endif