[llvm] 0144f50 - AttrBuilder::merge/remove - use const& for iterator values in for-range loops.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 1 04:01:31 PDT 2020
Author: Simon Pilgrim
Date: 2020-07-01T12:01:18+01:00
New Revision: 0144f501a63e62771c7e2552334a36c36f3a3686
URL: https://github.com/llvm/llvm-project/commit/0144f501a63e62771c7e2552334a36c36f3a3686
DIFF: https://github.com/llvm/llvm-project/commit/0144f501a63e62771c7e2552334a36c36f3a3686.diff
LOG: AttrBuilder::merge/remove - use const& for iterator values in for-range loops.
Noticed by clang-tidy performance-for-range-copy warning.
Added:
Modified:
llvm/lib/IR/Attributes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 8afa0e569514..8573e7f2fb7e 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1706,7 +1706,7 @@ AttrBuilder &AttrBuilder::merge(const AttrBuilder &B) {
Attrs |= B.Attrs;
- for (auto I : B.td_attrs())
+ for (const auto &I : B.td_attrs())
TargetDepAttrs[I.first] = I.second;
return *this;
@@ -1737,7 +1737,7 @@ AttrBuilder &AttrBuilder::remove(const AttrBuilder &B) {
Attrs &= ~B.Attrs;
- for (auto I : B.td_attrs())
+ for (const auto &I : B.td_attrs())
TargetDepAttrs.erase(I.first);
return *this;
More information about the llvm-commits
mailing list