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
This commit is contained in:
David Majnemer
2014-05-03 23:00:35 +00:00
parent b2bd7e89e6
commit b3428a05a0
2 changed files with 13 additions and 5 deletions

View File

@@ -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);
}