/// \brief Retrieve the attribute set node for the given "slot" in the
/// AttrNode list.
- AttributeSet getSlotNode(unsigned Slot) const {
+ AttributeSet getSlotAttributes(unsigned Slot) const {
return getSlotPair(Slot)->second;
}
- /// \brief Retrieve the attributes for the given "slot" in the AttrNode list.
- /// \p Slot is an index into the AttrNodes list, not the index of the return /
- /// parameter/ function which the attributes apply to.
- AttributeList getSlotAttributes(unsigned Slot) const {
- return AttributeList::get(Context, *getSlotPair(Slot));
- }
-
/// \brief Return true if the AttributeSet or the FunctionIndex has an
/// enum attribute of the given kind.
bool hasFnAttribute(Attribute::AttrKind Kind) const {
}
typedef AttributeSet::iterator iterator;
- iterator begin(unsigned Slot) const { return getSlotNode(Slot).begin(); }
- iterator end(unsigned Slot) const { return getSlotNode(Slot).end(); }
+ iterator begin(unsigned Slot) const {
+ return getSlotAttributes(Slot).begin();
+ }
+ iterator end(unsigned Slot) const { return getSlotAttributes(Slot).end(); }
void Profile(FoldingSetNodeID &ID) const;
static void Profile(FoldingSetNodeID &ID,
for (unsigned Index : Indices) {
// Add all attribute slots before the current index.
for (; I < E && getSlotIndex(I) < Index; ++I)
- AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotNode(I));
+ AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotAttributes(I));
// Add the attribute at this index. If we already have attributes at this
// index, merge them into a new set.
AttrBuilder B;
if (I < E && getSlotIndex(I) == Index) {
- B.merge(AttrBuilder(pImpl->getSlotNode(I)));
+ B.merge(AttrBuilder(pImpl->getSlotAttributes(I)));
++I;
}
B.addAttribute(A);
// Add remaining attributes.
for (; I < E; ++I)
- AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotNode(I));
+ AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotAttributes(I));
return get(C, AttrVec);
}
for (I = 0; I < NumAttrs; ++I) {
if (getSlotIndex(I) >= Index)
break;
- AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotNode(I));
+ AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotAttributes(I));
}
AttrBuilder NewAttrs;
if (I < NumAttrs && getSlotIndex(I) == Index) {
// We need to merge the attribute sets.
- NewAttrs.merge(pImpl->getSlotNode(I));
+ NewAttrs.merge(pImpl->getSlotAttributes(I));
++I;
}
NewAttrs.merge(B);
// Add the remaining entries.
for (; I < NumAttrs; ++I)
- AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotNode(I));
+ AttrVec.emplace_back(getSlotIndex(I), pImpl->getSlotAttributes(I));
return get(C, AttrVec);
}
for (unsigned I = 0, E = NumAttrs; I != E; ++I) {
if (getSlotIndex(I) >= Index) {
if (getSlotIndex(I) == Index)
- B = AttrBuilder(pImpl->getSlotNode(LastIndex++));
+ B = AttrBuilder(getSlotAttributes(LastIndex++));
break;
}
LastIndex = I + 1;
- AttrSets.push_back({getSlotIndex(I), pImpl->getSlotNode(I)});
+ AttrSets.push_back({getSlotIndex(I), getSlotAttributes(I)});
}
// Remove the attributes from the existing set and add them.
// Add the remaining attribute slots.
for (unsigned I = LastIndex, E = NumAttrs; I < E; ++I)
- AttrSets.push_back({getSlotIndex(I), pImpl->getSlotNode(I)});
+ AttrSets.push_back({getSlotIndex(I), getSlotAttributes(I)});
return get(C, AttrSets);
}
for (unsigned I = 0, E = pImpl->getNumSlots(); I != E; ++I) {
unsigned Index = getSlotIndex(I);
if (Index != WithoutIndex)
- AttrSet.push_back({Index, pImpl->getSlotNode(I)});
+ AttrSet.push_back({Index, pImpl->getSlotAttributes(I)});
}
return get(C, AttrSet);
}
// Loop through to find the attribute node we want.
for (unsigned I = 0, E = pImpl->getNumSlots(); I != E; ++I)
if (pImpl->getSlotIndex(I) == Index)
- return pImpl->getSlotNode(I);
+ return pImpl->getSlotAttributes(I);
return AttributeSet();
}
return pImpl->getSlotIndex(Slot);
}
-AttributeList AttributeList::getSlotAttributes(unsigned Slot) const {
+AttributeSet AttributeList::getSlotAttributes(unsigned Slot) const {
assert(pImpl && Slot < pImpl->getNumSlots() &&
"Slot # out of range!");
return pImpl->getSlotAttributes(Slot);
}
-AttributeSet AttributeList::getSlotSet(unsigned Slot) const {
- assert(pImpl && Slot < pImpl->getNumSlots() &&
- "Slot # out of range!");
- return pImpl->getSlotNode(Slot);
-}
-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void AttributeList::dump() const {
dbgs() << "PAL[\n";