summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-05-03 23:00:35 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-05-03 23:00:35 +0000
commitb3428a05a021bf067f70cd5363b70833f962c14f (patch)
tree1a397389b6e529e7ca26cc14e3b2a3084d69ec57 /lib/IR
parentb2bd7e89e64b73be1c412ba8942b40c106b3f070 (diff)
downloadllvm-b3428a05a021bf067f70cd5363b70833f962c14f.tar.gz
llvm-b3428a05a021bf067f70cd5363b70833f962c14f.tar.bz2
llvm-b3428a05a021bf067f70cd5363b70833f962c14f.tar.xz
IR: Cleanup AttributeSet::get for AttrBuilder
We don't modify the AttrBuilder in AttributeSet::get, make the reference argument const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/Attributes.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 96ba7670e4..0bbbd55978 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -596,7 +596,8 @@ AttributeSet AttributeSet::get(LLVMContext &C,
return getImpl(C, Attrs);
}
-AttributeSet AttributeSet::get(LLVMContext &C, unsigned Index, AttrBuilder &B) {
+AttributeSet AttributeSet::get(LLVMContext &C, unsigned Index,
+ const AttrBuilder &B) {
if (!B.hasAttributes())
return AttributeSet();
@@ -618,9 +619,9 @@ AttributeSet AttributeSet::get(LLVMContext &C, unsigned Index, AttrBuilder &B) {
}
// Add target-dependent (string) attributes.
- for (AttrBuilder::td_iterator I = B.td_begin(), E = B.td_end();
- I != E; ++I)
- Attrs.push_back(std::make_pair(Index, Attribute::get(C, I->first,I->second)));
+ for (const AttrBuilder::td_type &TDA : B.td_attrs())
+ Attrs.push_back(
+ std::make_pair(Index, Attribute::get(C, TDA.first, TDA.second)));
return get(C, Attrs);
}