projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7dc8926
)
AttrBuilder::merge/remove - use const& for iterator values in for-range loops.
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 30 Jun 2020 17:03:16 +0000
(18:03 +0100)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 1 Jul 2020 11:01:18 +0000
(12:01 +0100)
Noticed by clang-tidy performance-for-range-copy warning.
llvm/lib/IR/Attributes.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/IR/Attributes.cpp
b/llvm/lib/IR/Attributes.cpp
index
8afa0e5
..
8573e7f
100644
(file)
--- 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;