llvm.org GIT mirror llvm / 70cdaaa
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 Bill Wendling 7 years ago
1 changed file(s) with 8 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
751751 bool AttributeSet::hasAttrSomewhere(Attribute::AttrKind Attr) const {
752752 if (pImpl == 0) return false;
753753
754 ArrayRef Attrs = pImpl->getAttributes();
755 for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
756 if (Attrs[i].Attrs.hasAttribute(Attr))
757 return true;
754 for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I)
755 for (AttributeSetImpl::iterator II = pImpl->begin(I),
756 IE = pImpl->end(I); II != IE; ++II)
757 if (II->hasAttribute(Attr))
758 return true;
758759
759760 return false;
760761 }
787788 return *this;
788789
789790 SmallVector NewAttrList;
790 if (pImpl == 0)
791 if (pImpl == 0) {
791792 NewAttrList.push_back(AttributeWithIndex::get(Idx, Attrs));
792 else {
793 } else {
793794 ArrayRef OldAttrList = pImpl->getAttributes();
794795 unsigned i = 0, e = OldAttrList.size();
796
795797 // Copy attributes for arguments before this one.
796798 for (; i != e && OldAttrList[i].Index < Idx; ++i)
797799 NewAttrList.push_back(OldAttrList[i]);