diff options
author | Nico Weber <thakis@chromium.org> | 2020-02-22 19:38:50 -0500 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2020-02-23 12:48:36 +0000 |
commit | 214ec337a0b2745e6c41fbb3d562fa517122812f (patch) | |
tree | db901409ebce75201ebf6727ab9817dbcece9422 | |
parent | 847856089dc3f740f46f6f6af1be4c7cde50cdb2 (diff) | |
download | swiftshader-214ec337a0b2745e6c41fbb3d562fa517122812f.tar.gz |
Fix Wrange-loop-analysis warnings in swiftshader.
Bug: chromium:1039697
Change-Id: I5af47f44696a0eb1da7516ea57f3ae766651cae3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41548
Presubmit-Ready: Nico Weber <thakis@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
-rw-r--r-- | src/OpenGL/libGLESv2/Program.cpp | 2 | ||||
-rw-r--r-- | third_party/llvm-7.0/llvm/lib/CodeGen/InlineSpiller.cpp | 4 | ||||
-rw-r--r-- | third_party/llvm-7.0/llvm/lib/IR/Attributes.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/OpenGL/libGLESv2/Program.cpp b/src/OpenGL/libGLESv2/Program.cpp index cc4c49c06..eb1070ec4 100644 --- a/src/OpenGL/libGLESv2/Program.cpp +++ b/src/OpenGL/libGLESv2/Program.cpp @@ -1454,7 +1454,7 @@ namespace es2 } bool found = false; - for(const glsl::Varying varying : vertexShader->varyings) + for(const glsl::Varying& varying : vertexShader->varyings) { if(tfVaryingName == varying.name) { diff --git a/third_party/llvm-7.0/llvm/lib/CodeGen/InlineSpiller.cpp b/third_party/llvm-7.0/llvm/lib/CodeGen/InlineSpiller.cpp index 007e9283d..d88df6a62 100644 --- a/third_party/llvm-7.0/llvm/lib/CodeGen/InlineSpiller.cpp +++ b/third_party/llvm-7.0/llvm/lib/CodeGen/InlineSpiller.cpp @@ -1396,7 +1396,7 @@ void HoistSpillHelper::runHoistSpills( } // For spills in SpillsToKeep with LiveReg set (i.e., not original spill), // save them to SpillsToIns. - for (const auto Ent : SpillsToKeep) { + for (const auto& Ent : SpillsToKeep) { if (Ent.second) SpillsToIns[Ent.first->getBlock()] = Ent.second; } @@ -1470,7 +1470,7 @@ void HoistSpillHelper::hoistAllSpills() { StackIntvl.getValNumInfo(0)); // Insert hoisted spills. - for (auto const Insert : SpillsToIns) { + for (auto const& Insert : SpillsToIns) { MachineBasicBlock *BB = Insert.first; unsigned LiveReg = Insert.second; MachineBasicBlock::iterator MI = IPA.getLastInsertPointIter(OrigLI, *BB); diff --git a/third_party/llvm-7.0/llvm/lib/IR/Attributes.cpp b/third_party/llvm-7.0/llvm/lib/IR/Attributes.cpp index d87187481..8a9811eca 100644 --- a/third_party/llvm-7.0/llvm/lib/IR/Attributes.cpp +++ b/third_party/llvm-7.0/llvm/lib/IR/Attributes.cpp @@ -929,7 +929,7 @@ AttributeList::get(LLVMContext &C, MaxIndex = Attrs[Attrs.size() - 2].first; SmallVector<AttributeSet, 4> AttrVec(attrIdxToArrayIdx(MaxIndex) + 1); - for (const auto Pair : Attrs) + for (const auto& Pair : Attrs) AttrVec[attrIdxToArrayIdx(Pair.first)] = Pair.second; return getImpl(C, AttrVec); |