diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-28 00:46:02 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-28 00:46:02 +0000 |
commit | 70cdaaae925862b9d52d41729e93cf6417c3370b (patch) | |
tree | 019aef54d9714ef4095fc193fd78e8e0900704dd /lib | |
parent | 73bc452bcd63620daefb0a3bc613746af7418076 (diff) | |
download | external_llvm-70cdaaae925862b9d52d41729e93cf6417c3370b.zip external_llvm-70cdaaae925862b9d52d41729e93cf6417c3370b.tar.gz external_llvm-70cdaaae925862b9d52d41729e93cf6417c3370b.tar.bz2 |
Remove another use of AttributeWithIndex, using the AttributeSetImpl accessors instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IR/Attributes.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp index 59d3ef0..c41fb318 100644 --- a/lib/IR/Attributes.cpp +++ b/lib/IR/Attributes.cpp @@ -752,10 +752,11 @@ Attribute AttributeSet::getAttributes(unsigned Idx) const { bool AttributeSet::hasAttrSomewhere(Attribute::AttrKind Attr) const { if (pImpl == 0) return false; - ArrayRef<AttributeWithIndex> Attrs = pImpl->getAttributes(); - for (unsigned i = 0, e = Attrs.size(); i != e; ++i) - if (Attrs[i].Attrs.hasAttribute(Attr)) - return true; + for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I) + for (AttributeSetImpl::iterator II = pImpl->begin(I), + IE = pImpl->end(I); II != IE; ++II) + if (II->hasAttribute(Attr)) + return true; return false; } @@ -788,11 +789,12 @@ AttributeSet AttributeSet::addAttr(LLVMContext &C, unsigned Idx, return *this; SmallVector<AttributeWithIndex, 8> NewAttrList; - if (pImpl == 0) + if (pImpl == 0) { NewAttrList.push_back(AttributeWithIndex::get(Idx, Attrs)); - else { + } else { ArrayRef<AttributeWithIndex> OldAttrList = pImpl->getAttributes(); unsigned i = 0, e = OldAttrList.size(); + // Copy attributes for arguments before this one. for (; i != e && OldAttrList[i].Index < Idx; ++i) NewAttrList.push_back(OldAttrList[i]); |